From dc95ac6a4d4a5ff3e367aa00333a8bc87756e19f Mon Sep 17 00:00:00 2001 From: Paul Vollmer Date: Thu, 29 Jun 2023 07:46:24 +0200 Subject: [PATCH] chore: format code --- src/run.test.ts | 26 +++++++++++++++++--------- src/run.ts | 10 +++++++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/run.test.ts b/src/run.test.ts index f4b2f0c..36ad100 100644 --- a/src/run.test.ts +++ b/src/run.test.ts @@ -27,17 +27,20 @@ describe('run.ts', () => { jest.spyOn(os, 'arch').mockReturnValueOnce('unknown') const helmLinuxUrl = 'https://test.tld/helm-v3.8.0-linux-amd64.zip' - expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(helmLinuxUrl) + expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe( + helmLinuxUrl + ) expect(os.type).toBeCalled() expect(os.arch).toBeCalled() // arm64 jest.spyOn(os, 'type').mockReturnValue('Linux') jest.spyOn(os, 'arch').mockReturnValueOnce('arm64') - const helmLinuxArm64Url = - 'https://test.tld/helm-v3.8.0-linux-arm64.zip' + const helmLinuxArm64Url = 'https://test.tld/helm-v3.8.0-linux-arm64.zip' - expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(helmLinuxArm64Url) + expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe( + helmLinuxArm64Url + ) expect(os.type).toBeCalled() expect(os.arch).toBeCalled() }) @@ -49,17 +52,20 @@ describe('run.ts', () => { jest.spyOn(os, 'arch').mockReturnValueOnce('unknown') const helmDarwinUrl = 'https://test.tld/helm-v3.8.0-darwin-amd64.zip' - expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(helmDarwinUrl) + expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe( + helmDarwinUrl + ) expect(os.type).toBeCalled() expect(os.arch).toBeCalled() // arm64 jest.spyOn(os, 'type').mockReturnValue('Darwin') jest.spyOn(os, 'arch').mockReturnValueOnce('arm64') - const helmDarwinArm64Url = - 'https://test.tld/helm-v3.8.0-darwin-arm64.zip' + const helmDarwinArm64Url = 'https://test.tld/helm-v3.8.0-darwin-arm64.zip' - expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(helmDarwinArm64Url) + expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe( + helmDarwinArm64Url + ) expect(os.type).toBeCalled() expect(os.arch).toBeCalled() }) @@ -74,7 +80,9 @@ describe('run.ts', () => { jest.spyOn(os, 'type').mockReturnValue('Windows_NT') const helmWindowsUrl = 'https://test.tld/helm-v3.8.0-windows-amd64.zip' - expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe(helmWindowsUrl) + expect(run.getHelmDownloadURL(downloadBaseURL, 'v3.8.0')).toBe( + helmWindowsUrl + ) expect(os.type).toBeCalled() }) diff --git a/src/run.ts b/src/run.ts index a634147..4972eff 100644 --- a/src/run.ts +++ b/src/run.ts @@ -111,7 +111,7 @@ export function getHelmDownloadURL(baseURL: string, version: string): string { const arch = os.arch() const operatingSystem = os.type() - let urlPath = "" + let urlPath = '' switch (true) { case operatingSystem == LINUX && arch == ARM64: @@ -135,7 +135,10 @@ export function getHelmDownloadURL(baseURL: string, version: string): string { return url.toString() } -export async function downloadHelm(baseURL: string, version: string): Promise { +export async function downloadHelm( + baseURL: string, + version: string +): Promise { let cachedToolpath = toolCache.find(helmToolName, version) if (!cachedToolpath) { let helmDownloadPath @@ -146,7 +149,8 @@ export async function downloadHelm(baseURL: string, version: string): Promise