Skip to content

Commit 7ad2aa6

Browse files
Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <[email protected]>
1 parent a10d84b commit 7ad2aa6

File tree

7,655 files changed

+1763577
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,655 files changed

+1763577
-14
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,3 @@ ASALocalRun/
327327

328328
# MFractors (Xamarin productivity tool) working folder
329329
.mfractor/
330-
node_modules

lib/run.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ function downloadKubectl(version) {
5252
return __awaiter(this, void 0, void 0, function* () {
5353
let cachedToolpath = toolCache.find(kubectlToolName, version);
5454
let kubectlDownloadPath = '';
55-
const arch = helpers_1.getKubectlArch();
55+
const arch = (0, helpers_1.getKubectlArch)();
5656
if (!cachedToolpath) {
5757
try {
58-
kubectlDownloadPath = yield toolCache.downloadTool(helpers_1.getkubectlDownloadURL(version, arch));
58+
kubectlDownloadPath = yield toolCache.downloadTool((0, helpers_1.getkubectlDownloadURL)(version, arch));
5959
}
6060
catch (exception) {
6161
if (exception instanceof toolCache.HTTPError && exception.httpStatusCode === 404) {
@@ -65,9 +65,9 @@ function downloadKubectl(version) {
6565
throw new Error('DownloadKubectlFailed');
6666
}
6767
}
68-
cachedToolpath = yield toolCache.cacheFile(kubectlDownloadPath, kubectlToolName + helpers_1.getExecutableExtension(), kubectlToolName, version);
68+
cachedToolpath = yield toolCache.cacheFile(kubectlDownloadPath, kubectlToolName + (0, helpers_1.getExecutableExtension)(), kubectlToolName, version);
6969
}
70-
const kubectlPath = path.join(cachedToolpath, kubectlToolName + helpers_1.getExecutableExtension());
70+
const kubectlPath = path.join(cachedToolpath, kubectlToolName + (0, helpers_1.getExecutableExtension)());
7171
fs.chmodSync(kubectlPath, '777');
7272
return kubectlPath;
7373
});

lib/run.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const util = require("util");
2020
describe('Testing all functions in run file.', () => {
2121
test('getExecutableExtension() - return .exe when os is Windows', () => {
2222
jest.spyOn(os, 'type').mockReturnValue('Windows_NT');
23-
expect(helpers_1.getExecutableExtension()).toBe('.exe');
23+
expect((0, helpers_1.getExecutableExtension)()).toBe('.exe');
2424
expect(os.type).toBeCalled();
2525
});
2626
test('getExecutableExtension() - return empty string for non-windows OS', () => {
2727
jest.spyOn(os, 'type').mockReturnValue('Darwin');
28-
expect(helpers_1.getExecutableExtension()).toBe('');
28+
expect((0, helpers_1.getExecutableExtension)()).toBe('');
2929
expect(os.type).toBeCalled();
3030
});
3131
test.each([
@@ -34,7 +34,7 @@ describe('Testing all functions in run file.', () => {
3434
['x64', 'amd64']
3535
])("getKubectlArch() - return on %s os arch %s kubectl arch", (osArch, kubectlArch) => {
3636
jest.spyOn(os, 'arch').mockReturnValue(osArch);
37-
expect(helpers_1.getKubectlArch()).toBe(kubectlArch);
37+
expect((0, helpers_1.getKubectlArch)()).toBe(kubectlArch);
3838
expect(os.arch).toBeCalled();
3939
});
4040
test.each([
@@ -44,7 +44,7 @@ describe('Testing all functions in run file.', () => {
4444
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Linux', (arch) => {
4545
jest.spyOn(os, 'type').mockReturnValue('Linux');
4646
const kubectlLinuxUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/%s/kubectl', arch);
47-
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlLinuxUrl);
47+
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlLinuxUrl);
4848
expect(os.type).toBeCalled();
4949
});
5050
test.each([
@@ -54,7 +54,7 @@ describe('Testing all functions in run file.', () => {
5454
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Darwin', (arch) => {
5555
jest.spyOn(os, 'type').mockReturnValue('Darwin');
5656
const kubectlDarwinUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/darwin/%s/kubectl', arch);
57-
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlDarwinUrl);
57+
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlDarwinUrl);
5858
expect(os.type).toBeCalled();
5959
});
6060
test.each([
@@ -64,7 +64,7 @@ describe('Testing all functions in run file.', () => {
6464
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Windows', (arch) => {
6565
jest.spyOn(os, 'type').mockReturnValue('Windows_NT');
6666
const kubectlWindowsUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/windows/%s/kubectl.exe', arch);
67-
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl);
67+
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlWindowsUrl);
6868
expect(os.type).toBeCalled();
6969
});
7070
test('getStableKubectlVersion() - download stable version file, read version and return it', () => __awaiter(void 0, void 0, void 0, function* () {

0 commit comments

Comments
 (0)