Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AraHaan authored Jul 22, 2021
1 parent 0d7e834 commit e048e11
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ class Action
return spawnSync(TOOL, ARGS, options)
}

_executeInProcess(cmd)
{
var proc = this._executeCommand(cmd, { encoding: "utf-8", stdio: [process.stdin, process.stdout, process.stderr] })
if (proc.status > 0)
{
this._printErrorAndExit(`${/error.*/.exec(proc.stdout)[0]}`)
}
}

downloadInstallScript(url, dest)
{
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -67,7 +76,7 @@ class Action
console.log('Download Complete.')

// Windows.
this._executeCommand(`./dotnet-install.ps1 -Channel ${this.versionMajor}.${this.versionMinor} -Quality daily`)
this._executeInProcess(`./dotnet-install.ps1 -Channel ${this.versionMajor}.${this.versionMinor} -Quality daily`)
}
else
{
Expand All @@ -76,7 +85,7 @@ class Action
console.log('Download Complete.')

// Linux and MacOS.
this._executeCommand(`./dotnet-install.sh --channel ${this.versionMajor}.${this.versionMinor} --quality daily`)
this._executeInProcess(`./dotnet-install.sh --channel ${this.versionMajor}.${this.versionMinor} --quality daily`)
}
}
}
Expand Down

0 comments on commit e048e11

Please sign in to comment.