Vidya reddy prettier (#58)
* upgraded to Node16 * Enforce Prettier * code fix * jest version change and prettify code Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com>
This commit is contained in:
parent
b474dc39ef
commit
2eb2a370ff
20 changed files with 11418 additions and 11311 deletions
|
@ -1,31 +1,43 @@
|
|||
import * as os from 'os';
|
||||
import * as util from 'util';
|
||||
import * as os from 'os'
|
||||
import * as util from 'util'
|
||||
|
||||
export function getKubectlArch(): string {
|
||||
const arch = os.arch();
|
||||
if (arch === 'x64') {
|
||||
return 'amd64';
|
||||
}
|
||||
return arch;
|
||||
const arch = os.arch()
|
||||
if (arch === 'x64') {
|
||||
return 'amd64'
|
||||
}
|
||||
return arch
|
||||
}
|
||||
|
||||
export function getkubectlDownloadURL(version: string, arch: string): string {
|
||||
switch (os.type()) {
|
||||
case 'Linux':
|
||||
return util.format('https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubectl', 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 '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);
|
||||
}
|
||||
case 'Windows_NT':
|
||||
default:
|
||||
return util.format(
|
||||
'https://storage.googleapis.com/kubernetes-release/release/%s/bin/windows/%s/kubectl.exe',
|
||||
version,
|
||||
arch
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export function getExecutableExtension(): string {
|
||||
if (os.type().match(/^Win/)) {
|
||||
return '.exe';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
if (os.type().match(/^Win/)) {
|
||||
return '.exe'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue