Skip to content

Commit 861c756

Browse files
authored
Adding tool binaries to PATH (#4) (#5)
* Adding tool binaries to PATH * Resolving PR comments
1 parent 4b33fbc commit 861c756

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/run.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"use strict";
22
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
34
return new (P || (P = Promise))(function (resolve, reject) {
45
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
56
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
7+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
78
step((generator = generator.apply(thisArg, _arguments || [])).next());
89
});
910
};
@@ -74,6 +75,7 @@ function run() {
7475
version = yield getStableKubectlVersion();
7576
}
7677
let cachedPath = yield downloadKubectl(version);
78+
core.addPath(path.dirname(cachedPath));
7779
console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`);
7880
core.setOutput('kubectl-path', cachedPath);
7981
});

src/run.ts

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ async function run() {
7070
version = await getStableKubectlVersion();
7171
}
7272
let cachedPath = await downloadKubectl(version);
73+
74+
core.addPath(path.dirname(cachedPath));
75+
7376
console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`);
7477
core.setOutput('kubectl-path', cachedPath);
7578
}

0 commit comments

Comments
 (0)