@@ -26,7 +26,7 @@ private static string config(string @default = null, [CallerMemberName] string k
26
26
public const string TemplateJsonVersion = "3.1.1648" ;
27
27
28
28
public static readonly string SBOMManifestToolPath = Path . GetFullPath ( "../ManifestTool/Microsoft.ManifestTool.dll" ) ;
29
-
29
+
30
30
public static readonly string SrcProjectPath = Path . GetFullPath ( "../src/Azure.Functions.Cli/" ) ;
31
31
32
32
public static readonly string ConstantsFile = Path . Combine ( SrcProjectPath , "Common" , "Constants.cs" ) ;
@@ -79,6 +79,43 @@ private static string config(string @default = null, [CallerMemberName] string k
79
79
"win7-x64"
80
80
} ;
81
81
82
+ private static readonly string [ ] _linPowershellRuntimes = new [ ]
83
+ {
84
+ "linux" ,
85
+ "linux-x64" ,
86
+ "unix" ,
87
+ "linux-musl-x64"
88
+ } ;
89
+
90
+ private static readonly string [ ] _osxPowershellRuntimes = new [ ]
91
+ {
92
+ "osx" ,
93
+ "osx-x64" ,
94
+ "unix"
95
+ } ;
96
+
97
+ private static readonly string [ ] _osxARMPowershellRuntimes = new [ ]
98
+ {
99
+ "osx" ,
100
+ "osx-arm64" ,
101
+ "unix"
102
+ } ;
103
+
104
+ private static Dictionary < string , string [ ] > GetPowerShellRuntimes ( )
105
+ {
106
+ var runtimes = new Dictionary < string , string [ ] >
107
+ {
108
+ { "win-x86" , _winPowershellRuntimes } ,
109
+ { "win-x64" , _winPowershellRuntimes } ,
110
+ { "win-arm64" , _winPowershellRuntimes } ,
111
+ { "linux-x64" , _linPowershellRuntimes } ,
112
+ { "osx-x64" , _osxPowershellRuntimes } ,
113
+ { "osx-arm64" , _osxARMPowershellRuntimes }
114
+ } ;
115
+
116
+ return runtimes ;
117
+ }
118
+
82
119
public static readonly Dictionary < string , Dictionary < string , string [ ] > > ToolsRuntimeToPowershellRuntimes = new Dictionary < string , Dictionary < string , string [ ] > >
83
120
{
84
121
{
@@ -88,8 +125,8 @@ private static string config(string @default = null, [CallerMemberName] string k
88
125
{ "win-x86" , _winPowershellRuntimes } ,
89
126
{ "win-x64" , _winPowershellRuntimes } ,
90
127
{ "win-arm64" , _winPowershellRuntimes } ,
91
- { "linux-x64" , new [ ] { "linux" , "linux-x64" , "unix" , "linux-musl-x64" } } ,
92
- { "osx-x64" , new [ ] { "osx" , "osx-x64" , "unix" } } ,
128
+ { "linux-x64" , _linPowershellRuntimes } ,
129
+ { "osx-x64" , _osxPowershellRuntimes } ,
93
130
// NOTE: PowerShell 7.0 does not support arm. First version supporting it is 7.2
94
131
// https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos?view=powershell-7.2#supported-versions
95
132
// That being said, we might as well include "osx" and "unix" since it'll hardly affect package size and should lead to more accurate error messages
@@ -98,15 +135,11 @@ private static string config(string @default = null, [CallerMemberName] string k
98
135
} ,
99
136
{
100
137
"7.2" ,
101
- new Dictionary < string , string [ ] >
102
- {
103
- { "win-x86" , _winPowershellRuntimes } ,
104
- { "win-x64" , _winPowershellRuntimes } ,
105
- { "win-arm64" , _winPowershellRuntimes } ,
106
- { "linux-x64" , new [ ] { "linux" , "linux-x64" , "unix" , "linux-musl-x64" } } ,
107
- { "osx-x64" , new [ ] { "osx" , "osx-x64" , "unix" } } ,
108
- { "osx-arm64" , new [ ] { "osx" , "osx-arm64" , "unix" } }
109
- }
138
+ GetPowerShellRuntimes ( )
139
+ } ,
140
+ {
141
+ "7.4" ,
142
+ GetPowerShellRuntimes ( )
110
143
}
111
144
} ;
112
145
0 commit comments