mirror of
https://gitea.com/actions/setup-go.git
synced 2024-11-23 18:03:23 +08:00
lint
This commit is contained in:
parent
3d89e603f2
commit
93ddff5bef
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -1331,6 +1331,7 @@ function addBinToPath() {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let added = false;
|
let added = false;
|
||||||
let g = yield io.which('go');
|
let g = yield 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;
|
||||||
@ -1338,7 +1339,7 @@ function addBinToPath() {
|
|||||||
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)) {
|
||||||
@ -1348,6 +1349,9 @@ function addBinToPath() {
|
|||||||
core.addPath(bp);
|
core.addPath(bp);
|
||||||
added = true;
|
added = true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
core.debug('go env GOPATH does not exist');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return added;
|
return added;
|
||||||
});
|
});
|
||||||
|
@ -82,8 +82,7 @@ async function addBinToPath(): Promise<boolean> {
|
|||||||
|
|
||||||
core.addPath(bp);
|
core.addPath(bp);
|
||||||
added = true;
|
added = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
core.debug('go env GOPATH does not exist');
|
core.debug('go env GOPATH does not exist');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user