mirror of
https://github.com/actions/setup-go.git
synced 2025-07-27 00:48:27 +02:00
gobin: use execFile instead of exec to query GOPATH
Should fix the behavior on Windows.
This commit is contained in:
parent
0dbc2e7f12
commit
4241f446d8
3 changed files with 7 additions and 7 deletions
|
@ -2,12 +2,12 @@ import * as childProcess from 'child_process';
|
|||
import * as path from 'path';
|
||||
import {promisify} from 'util';
|
||||
|
||||
const exec = promisify(childProcess.exec);
|
||||
const execFile = promisify(childProcess.execFile);
|
||||
|
||||
export async function getGOBIN(installDir: string): Promise<string> {
|
||||
const goExecutable = path.join(installDir, 'bin', 'go');
|
||||
|
||||
const result = await exec(`${goExecutable} env GOPATH`);
|
||||
const result = await execFile(goExecutable, ['env', 'GOPATH']);
|
||||
const gopath = result.stdout;
|
||||
return path.join(gopath, 'bin');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue