3
0
Fork 0
mirror of https://gitea.com/actions/setup-go.git synced 2024-11-25 19:19:33 +01:00

more debug

This commit is contained in:
Bryan MacFarlane 2020-03-26 12:54:21 -04:00
parent 1fea44b3f0
commit 3d89e603f2

View file

@ -63,6 +63,7 @@ export async function run() {
async function addBinToPath(): Promise<boolean> { async function addBinToPath(): Promise<boolean> {
let added = false; let added = false;
let g = await io.which('go'); let g = await io.which('go');
core.debug(`which go :${g};`);
if (!g) { if (!g) {
core.debug('go not in the path'); core.debug('go not in the path');
return added; return added;
@ -71,7 +72,7 @@ async function addBinToPath(): Promise<boolean> {
let buf = cp.execSync('go env GOPATH'); let buf = cp.execSync('go env GOPATH');
if (buf) { if (buf) {
let gp = buf.toString().trim(); let gp = buf.toString().trim();
core.debug(`go env GOPATH: ${gp}`); core.debug(`go env GOPATH :${gp}:`);
if (fs.existsSync(gp)) { if (fs.existsSync(gp)) {
let bp = path.join(gp, 'bin'); let bp = path.join(gp, 'bin');
if (!fs.existsSync(bp)) { if (!fs.existsSync(bp)) {
@ -82,6 +83,9 @@ async function addBinToPath(): Promise<boolean> {
core.addPath(bp); core.addPath(bp);
added = true; added = true;
} }
else {
core.debug('go env GOPATH does not exist');
}
} }
return added; return added;
} }