mirror of
https://github.com/actions/setup-go.git
synced 2025-04-22 17:10:50 +00:00
14 lines
412 B
TypeScript
14 lines
412 B
TypeScript
|
import * as childProcess from 'child_process';
|
||
|
import * as path from 'path';
|
||
|
import {promisify} from 'util';
|
||
|
|
||
|
const exec = promisify(childProcess.exec);
|
||
|
|
||
|
export async function getGOBIN(installDir: string): Promise<string> {
|
||
|
const goExecutable = path.join(installDir, 'bin', 'go');
|
||
|
|
||
|
const result = await exec(`${goExecutable} env GOPATH`);
|
||
|
const gopath = result.stdout;
|
||
|
return path.join(gopath, 'bin');
|
||
|
}
|