mirror of https://github.com/actions/setup-go.git
format
parent
4282769cc0
commit
dc575ee3b3
@ -1,3 +1,3 @@
|
|||||||
import {run} from './main'
|
import {run} from './main';
|
||||||
|
|
||||||
run();
|
run();
|
||||||
|
@ -1,37 +1,37 @@
|
|||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
||||||
export function getPlatform(): string {
|
export function getPlatform(): string {
|
||||||
// darwin and linux match already
|
// darwin and linux match already
|
||||||
// freebsd not supported yet but future proofed.
|
// freebsd not supported yet but future proofed.
|
||||||
|
|
||||||
// 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'
|
// 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'
|
||||||
let plat: string = os.platform();
|
let plat: string = os.platform();
|
||||||
|
|
||||||
// wants 'darwin', 'freebsd', 'linux', 'windows'
|
// wants 'darwin', 'freebsd', 'linux', 'windows'
|
||||||
if (plat === 'win32') {
|
if (plat === 'win32') {
|
||||||
plat = 'windows';
|
plat = 'windows';
|
||||||
}
|
|
||||||
|
|
||||||
return plat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getArch(): string {
|
return plat;
|
||||||
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
}
|
||||||
let arch: string = os.arch();
|
|
||||||
|
|
||||||
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
export function getArch(): string {
|
||||||
// currently not supported by runner but future proofed mapping
|
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.
|
||||||
switch (arch) {
|
let arch: string = os.arch();
|
||||||
case 'x64':
|
|
||||||
arch = 'amd64';
|
|
||||||
break;
|
|
||||||
case 'ppc':
|
|
||||||
arch = 'ppc64';
|
|
||||||
break;
|
|
||||||
case 'x32':
|
|
||||||
arch = '386';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return arch;
|
// wants amd64, 386, arm64, armv61, ppc641e, s390x
|
||||||
|
// currently not supported by runner but future proofed mapping
|
||||||
|
switch (arch) {
|
||||||
|
case 'x64':
|
||||||
|
arch = 'amd64';
|
||||||
|
break;
|
||||||
|
case 'ppc':
|
||||||
|
arch = 'ppc64';
|
||||||
|
break;
|
||||||
|
case 'x32':
|
||||||
|
arch = '386';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return arch;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue