Skip to content

Commit

Permalink
Make setup script functions synchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Laevskii committed May 30, 2023
1 parent 820f30d commit addb470
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
40 changes: 18 additions & 22 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,30 +351,26 @@ class DotnetInstallScript {
this.setupScriptBash();
}
setupScriptPowershell() {
return __awaiter(this, void 0, void 0, function* () {
this.scriptArguments = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command'
];
this.scriptArguments.push('&', `'${this.escapedScript}'`);
if (process.env['https_proxy'] != null) {
this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`);
}
// This is not currently an option
if (process.env['no_proxy'] != null) {
this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
}
});
this.scriptArguments = [
'-NoLogo',
'-Sta',
'-NoProfile',
'-NonInteractive',
'-ExecutionPolicy',
'Unrestricted',
'-Command'
];
this.scriptArguments.push('&', `'${this.escapedScript}'`);
if (process.env['https_proxy'] != null) {
this.scriptArguments.push(`-ProxyAddress ${process.env['https_proxy']}`);
}
// This is not currently an option
if (process.env['no_proxy'] != null) {
this.scriptArguments.push(`-ProxyBypassList ${process.env['no_proxy']}`);
}
}
setupScriptBash() {
return __awaiter(this, void 0, void 0, function* () {
(0, fs_1.chmodSync)(this.escapedScript, '777');
});
(0, fs_1.chmodSync)(this.escapedScript, '777');
}
getScriptPath() {
return __awaiter(this, void 0, void 0, function* () {
Expand Down
4 changes: 2 additions & 2 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class DotnetInstallScript {
this.setupScriptBash();
}

private async setupScriptPowershell() {
private setupScriptPowershell() {
this.scriptArguments = [
'-NoLogo',
'-Sta',
Expand All @@ -165,7 +165,7 @@ export class DotnetInstallScript {
}
}

private async setupScriptBash() {
private setupScriptBash() {
chmodSync(this.escapedScript, '777');
}

Expand Down

0 comments on commit addb470

Please sign in to comment.