Make setup script functions synchronous

This commit is contained in:
Nikolai Laevskii 2023-05-30 13:19:37 +02:00
parent 820f30d332
commit addb470701
2 changed files with 20 additions and 24 deletions

40
dist/index.js vendored
View File

@ -351,30 +351,26 @@ class DotnetInstallScript {
this.setupScriptBash(); this.setupScriptBash();
} }
setupScriptPowershell() { setupScriptPowershell() {
return __awaiter(this, void 0, void 0, function* () { this.scriptArguments = [
this.scriptArguments = [ '-NoLogo',
'-NoLogo', '-Sta',
'-Sta', '-NoProfile',
'-NoProfile', '-NonInteractive',
'-NonInteractive', '-ExecutionPolicy',
'-ExecutionPolicy', 'Unrestricted',
'Unrestricted', '-Command'
'-Command' ];
]; this.scriptArguments.push('&', `'${this.escapedScript}'`);
this.scriptArguments.push('&', `'${this.escapedScript}'`); if (process.env['https_proxy'] != null) {
if (process.env['https_proxy'] != null) { this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`);
this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`); }
} // This is not currently an option
// This is not currently an option if (process.env['no_proxy'] != null) {
if (process.env['no_proxy'] != null) { this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`); }
}
});
} }
setupScriptBash() { setupScriptBash() {
return __awaiter(this, void 0, void 0, function* () { (0, fs_1.chmodSync)(this.escapedScript, '777');
(0, fs_1.chmodSync)(this.escapedScript, '777');
});
} }
getScriptPath() { getScriptPath() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {

View File

@ -143,7 +143,7 @@ export class DotnetInstallScript {
this.setupScriptBash(); this.setupScriptBash();
} }
private async setupScriptPowershell() { private setupScriptPowershell() {
this.scriptArguments = [ this.scriptArguments = [
'-NoLogo', '-NoLogo',
'-Sta', '-Sta',
@ -165,7 +165,7 @@ export class DotnetInstallScript {
} }
} }
private async setupScriptBash() { private setupScriptBash() {
chmodSync(this.escapedScript, '777'); chmodSync(this.escapedScript, '777');
} }