Added new func for resolving image tag default
parent
bb51f4aca4
commit
ccedbb68b5
|
@ -265,7 +265,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const platform_1 = __importDefault(__nccwpck_require__(9707));
|
const platform_1 = __importDefault(__nccwpck_require__(9707));
|
||||||
class ImageTag {
|
class ImageTag {
|
||||||
constructor(imageProperties) {
|
constructor(imageProperties) {
|
||||||
const { editorVersion = '2019.2.11f1', targetPlatform = platform_1.default.types.StandaloneLinux64, customImage, } = imageProperties;
|
const { editorVersion = '2019.2.11f1', targetPlatform = ImageTag.getImagePlatformType(process.platform), customImage, } = imageProperties;
|
||||||
if (!ImageTag.versionPattern.test(editorVersion)) {
|
if (!ImageTag.versionPattern.test(editorVersion)) {
|
||||||
throw new Error(`Invalid version "${editorVersion}".`);
|
throw new Error(`Invalid version "${editorVersion}".`);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ class ImageTag {
|
||||||
generic: '',
|
generic: '',
|
||||||
webgl: 'webgl',
|
webgl: 'webgl',
|
||||||
mac: 'mac-mono',
|
mac: 'mac-mono',
|
||||||
windows: 'windows-mono',
|
windows: 'windows-il2cpp',
|
||||||
linux: 'base',
|
linux: 'base',
|
||||||
linuxIl2cpp: 'linux-il2cpp',
|
linuxIl2cpp: 'linux-il2cpp',
|
||||||
android: 'android',
|
android: 'android',
|
||||||
|
@ -303,7 +303,17 @@ class ImageTag {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return 'windows';
|
return 'windows';
|
||||||
default:
|
default:
|
||||||
throw new Error('The Operating System of this runner is not yet supported.');
|
throw new Error(`The Operating System of this runner, "${platform}", is not yet supported.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static getImagePlatformType(platform) {
|
||||||
|
switch (platform) {
|
||||||
|
case 'linux':
|
||||||
|
return platform_1.default.types.StandaloneLinux64;
|
||||||
|
case 'win32':
|
||||||
|
return platform_1.default.types.StandaloneWindows;
|
||||||
|
default:
|
||||||
|
throw new Error(`The Operating System of this runner, "${platform}", is not yet supported.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static getTargetPlatformSuffix(targetPlatform, editorVersion) {
|
static getTargetPlatformSuffix(targetPlatform, editorVersion) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@ class ImageTag {
|
||||||
constructor(imageProperties) {
|
constructor(imageProperties) {
|
||||||
const {
|
const {
|
||||||
editorVersion = '2019.2.11f1',
|
editorVersion = '2019.2.11f1',
|
||||||
targetPlatform = Platform.types.StandaloneLinux64,
|
targetPlatform = ImageTag.getImagePlatformType(process.platform),
|
||||||
customImage,
|
customImage,
|
||||||
} = imageProperties;
|
} = imageProperties;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class ImageTag {
|
||||||
generic: '',
|
generic: '',
|
||||||
webgl: 'webgl',
|
webgl: 'webgl',
|
||||||
mac: 'mac-mono',
|
mac: 'mac-mono',
|
||||||
windows: 'windows-mono',
|
windows: 'windows-il2cpp',
|
||||||
linux: 'base',
|
linux: 'base',
|
||||||
linuxIl2cpp: 'linux-il2cpp',
|
linuxIl2cpp: 'linux-il2cpp',
|
||||||
android: 'android',
|
android: 'android',
|
||||||
|
@ -59,7 +59,22 @@ class ImageTag {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
return 'windows';
|
return 'windows';
|
||||||
default:
|
default:
|
||||||
throw new Error('The Operating System of this runner is not yet supported.');
|
throw new Error(
|
||||||
|
`The Operating System of this runner, "${platform}", is not yet supported.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static getImagePlatformType(platform) {
|
||||||
|
switch (platform) {
|
||||||
|
case 'linux':
|
||||||
|
return Platform.types.StandaloneLinux64;
|
||||||
|
case 'win32':
|
||||||
|
return Platform.types.StandaloneWindows;
|
||||||
|
default:
|
||||||
|
throw new Error(
|
||||||
|
`The Operating System of this runner, "${platform}", is not yet supported.`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue