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

Method tryInstallFromGHRelease

src/AzModuleInstaller.ts:114–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112 }
113
114 private async tryInstallFromGHRelease() {
115 if (this.installResult.isInstalled) {
116 core.debug(`Module already installed skipping tryInstallFromGHRelease`);
117 return;
118 }
119
120 try {
121 const downloadUrl = await this.getDownloadUrlFromGHRelease();
122 core.debug(`Downloading Az ${this.version} from GHRelease using url ${downloadUrl}`);
123 await tc.downloadTool(downloadUrl, this.moduleZipPath, this.githubAuth);
124 core.debug(`Expanding Az ${this.version} downloaded at ${this.moduleZipPath} as zip.`);
125 await new ArchiveTools(this.isWin).unzip(this.moduleZipPath, this.moduleRoot);
126 await FileUtils.deleteFile(this.moduleZipPath);
127 this.installResult = {
128 isInstalled: true,
129 moduleSource: AzModuleSource.GHRelease
130 };
131 } catch (err) {
132 core.debug(err);
133 core.info("Download from GHRelease failed, will fallback to PSGallery");
134 }
135 }
136
137 private async tryInstallFromPSGallery() {
138 if (this.installResult.isInstalled) {

Callers 1

installMethod · 0.95

Calls 3

unzipMethod · 0.45
deleteFileMethod · 0.45

Tested by

no test coverage detected