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

Method tryInstallFromGHRelease

lib/index.js:7788–7811  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7786 });
7787 }
7788 tryInstallFromGHRelease() {
7789 return __awaiter(this, void 0, void 0, function* () {
7790 if (this.installResult.isInstalled) {
7791 core.debug(`Module already installed skipping tryInstallFromGHRelease`);
7792 return;
7793 }
7794 try {
7795 const downloadUrl = yield this.getDownloadUrlFromGHRelease();
7796 core.debug(`Downloading Az ${this.version} from GHRelease using url ${downloadUrl}`);
7797 yield tc.downloadTool(downloadUrl, this.moduleZipPath, this.githubAuth);
7798 core.debug(`Expanding Az ${this.version} downloaded at ${this.moduleZipPath} as zip.`);
7799 yield new ArchiveTools_1.ArchiveTools(this.isWin).unzip(this.moduleZipPath, this.moduleRoot);
7800 yield FileUtils_1.default.deleteFile(this.moduleZipPath);
7801 this.installResult = {
7802 isInstalled: true,
7803 moduleSource: exports.AzModuleSource.GHRelease
7804 };
7805 }
7806 catch (err) {
7807 core.debug(err);
7808 core.info("Download from GHRelease failed, will fallback to PSGallery");
7809 }
7810 });
7811 }
7812 tryInstallFromPSGallery() {
7813 return __awaiter(this, void 0, void 0, function* () {
7814 if (this.installResult.isInstalled) {

Callers 1

installMethod · 0.95

Calls 3

unzipMethod · 0.45
deleteFileMethod · 0.45

Tested by

no test coverage detected