MCPcopy Create free account
hub / github.com/Azure/powershell / getDefaultAzInstallFolder

Method getDefaultAzInstallFolder

src/Utilities/Utils.ts:34–58  ·  view source on GitHub ↗
(os:string)

Source from the content-addressed store, hash-verified

32 }
33
34 static getDefaultAzInstallFolder(os:string): string{
35 let defaultAzInstallFolder = "";
36 switch (os) {
37 case "linux":
38 defaultAzInstallFolder = "/usr/share";
39 break;
40 case "windows":
41 case "windows_nt":
42 defaultAzInstallFolder = "C:\\Modules";
43 break;
44 case "macos":
45 case "darwin":
46 default:
47 defaultAzInstallFolder = "";
48 break;
49 }
50
51 if(Utils.isFolderExistAndWritable(defaultAzInstallFolder)){
52 return defaultAzInstallFolder;
53 }
54 if(Utils.isFolderExistAndWritable(process.env.RUNNER_TOOL_CACHE)){
55 return process.env.RUNNER_TOOL_CACHE;
56 }
57 return process.cwd();
58 }
59
60 static isFolderExistAndWritable(folderPath:string) : boolean{
61 if(!folderPath){

Callers 2

constructorMethod · 0.45
setPSModulePathMethod · 0.45

Calls 1

Tested by

no test coverage detected