Updating files as per latest changes in master after resolving merge conflicts

This commit is contained in:
Shivam Gupta
2021-03-30 22:39:31 +05:30
parent 4420cb2ff7
commit a3f3ca8682
3 changed files with 6067 additions and 78 deletions

View File

@ -31,7 +31,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStableHelmVersion = void 0;
exports.run = exports.findHelm = exports.downloadHelm = exports.walkSync = exports.getStableHelmVersion = exports.getHelmDownloadURL = exports.getExecutableExtension = void 0;
const os = __importStar(require("os"));
const path = __importStar(require("path"));
const util = __importStar(require("util"));
@ -53,6 +53,7 @@ function getExecutableExtension() {
}
return '';
}
exports.getExecutableExtension = getExecutableExtension;
function getHelmDownloadURL(version) {
switch (os.type()) {
case 'Linux':
@ -64,6 +65,7 @@ function getHelmDownloadURL(version) {
return util.format('https://get.helm.sh/helm-%s-windows-amd64.zip', version);
}
}
exports.getHelmDownloadURL = getHelmDownloadURL;
function getStableHelmVersion() {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -91,12 +93,12 @@ function getStableHelmVersion() {
});
}
exports.getStableHelmVersion = getStableHelmVersion;
var walkSync = function (dir, filelist, fileToFind) {
exports.walkSync = function (dir, filelist, fileToFind) {
var files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function (file) {
if (fs.statSync(path.join(dir, file)).isDirectory()) {
filelist = walkSync(path.join(dir, file), filelist, fileToFind);
filelist = exports.walkSync(path.join(dir, file), filelist, fileToFind);
}
else {
core.debug(file);
@ -110,7 +112,7 @@ var walkSync = function (dir, filelist, fileToFind) {
function downloadHelm(version) {
return __awaiter(this, void 0, void 0, function* () {
if (!version) {
version = yield getLatestHelmVersionFor("v3");
version = yield getStableHelmVersion();
}
let cachedToolpath = toolCache.find(helmToolName, version);
if (!cachedToolpath) {
@ -133,6 +135,7 @@ function downloadHelm(version) {
return helmpath;
});
}
exports.downloadHelm = downloadHelm;
function getLatestHelmVersionFor(type) {
return __awaiter(this, void 0, void 0, function* () {
const token = core.getInput('token', { 'required': true });
@ -175,14 +178,15 @@ function isValidVersion(version, type) {
function findHelm(rootFolder) {
fs.chmodSync(rootFolder, '777');
var filelist = [];
walkSync(rootFolder, filelist, helmToolName + getExecutableExtension());
if (!filelist) {
throw new Error(util.format("Helm executable not found in path ", rootFolder));
exports.walkSync(rootFolder, filelist, helmToolName + getExecutableExtension());
if (!filelist || filelist.length == 0) {
throw new Error(util.format("Helm executable not found in path", rootFolder));
}
else {
return filelist[0];
}
}
exports.findHelm = findHelm;
function run() {
return __awaiter(this, void 0, void 0, function* () {
let version = core.getInput('version', { 'required': true });
@ -219,4 +223,5 @@ function run() {
core.setOutput('helm-path', cachedPath);
});
}
exports.run = run;
run().catch(core.setFailed);

6108
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,14 +20,14 @@ const LATEST_HELM2_VERSION = '2.*';
const LATEST_HELM3_VERSION = '3.*';
const helmAllReleasesUrl = 'https://api.github.com/repos/helm/helm/releases';
function getExecutableExtension(): string {
export function getExecutableExtension(): string {
if (os.type().match(/^Win/)) {
return '.exe';
}
return '';
}
function getHelmDownloadURL(version: string): string {
export function getHelmDownloadURL(version: string): string {
switch (os.type()) {
case 'Linux':
return util.format('https://get.helm.sh/helm-%s-linux-amd64.zip', version);
@ -66,7 +66,7 @@ export async function getStableHelmVersion(): Promise<string> {
return stableHelmVersion;
}
var walkSync = function (dir, filelist, fileToFind) {
export var walkSync = function (dir, filelist, fileToFind) {
var files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function (file) {
@ -83,8 +83,8 @@ var walkSync = function (dir, filelist, fileToFind) {
return filelist;
};
async function downloadHelm(version: string): Promise<string> {
if (!version) { version = await getLatestHelmVersionFor("v3"); }
export async function downloadHelm(version: string): Promise<string> {
if (!version) { version = await getStableHelmVersion(); }
let cachedToolpath = toolCache.find(helmToolName, version);
if (!cachedToolpath) {
let helmDownloadPath;
@ -151,19 +151,19 @@ function isValidVersion(version: string, type: string): boolean {
return version.indexOf('rc') == -1;
}
function findHelm(rootFolder: string): string {
export function findHelm(rootFolder: string): string {
fs.chmodSync(rootFolder, '777');
var filelist: string[] = [];
walkSync(rootFolder, filelist, helmToolName + getExecutableExtension());
if (!filelist) {
throw new Error(util.format("Helm executable not found in path ", rootFolder));
if (!filelist || filelist.length == 0) {
throw new Error(util.format("Helm executable not found in path", rootFolder));
}
else {
return filelist[0];
}
}
async function run() {
export async function run() {
let version = core.getInput('version', { 'required': true });
if (process.env['HELM_INSTALLER_LEGACY_VERSIONING'] == 'true') {