Ran npm run build
This commit is contained in:
parent
dc0d137473
commit
24ccaa544b
2 changed files with 195 additions and 0 deletions
32
lib/helpers.js
Normal file
32
lib/helpers.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getExecutableExtension = exports.getkubectlDownloadURL = exports.getKubectlArch = void 0;
|
||||
const os = require("os");
|
||||
const util = require("util");
|
||||
function getKubectlArch() {
|
||||
const arch = os.arch();
|
||||
if (arch === 'x64') {
|
||||
return 'amd64';
|
||||
}
|
||||
return arch;
|
||||
}
|
||||
exports.getKubectlArch = getKubectlArch;
|
||||
function getkubectlDownloadURL(version, arch) {
|
||||
switch (os.type()) {
|
||||
case 'Linux':
|
||||
return util.format('https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubectl', version, arch);
|
||||
case 'Darwin':
|
||||
return util.format('https://storage.googleapis.com/kubernetes-release/release/%s/bin/darwin/%s/kubectl', version, arch);
|
||||
case 'Windows_NT':
|
||||
default:
|
||||
return util.format('https://storage.googleapis.com/kubernetes-release/release/%s/bin/windows/%s/kubectl.exe', version, arch);
|
||||
}
|
||||
}
|
||||
exports.getkubectlDownloadURL = getkubectlDownloadURL;
|
||||
function getExecutableExtension() {
|
||||
if (os.type().match(/^Win/)) {
|
||||
return '.exe';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
exports.getExecutableExtension = getExecutableExtension;
|
Loading…
Add table
Add a link
Reference in a new issue