Fix lint issues and make paths more understandable

pull/305/head
Andrew Kahr 2022-01-24 15:39:14 -08:00
parent b16eb09671
commit 3b3ea8c574
4 changed files with 154 additions and 149 deletions

12
dist/index.js vendored
View File

@ -116,9 +116,9 @@ class Action {
static get dockerfile() {
const currentPlatform = process.platform;
switch (currentPlatform) {
case "linux":
case 'linux':
return `${Action.actionFolder}/platforms/ubuntu/Dockerfile`;
case "win32":
case 'win32':
return `${Action.actionFolder}/platforms/windows/Dockerfile`;
default:
throw new Error(`No Dockerfile for currently unsupported platform: ${currentPlatform}`);
@ -1351,7 +1351,8 @@ class ValidateWindows {
}
static checkForWin10SDK() {
//Check for Windows 10 SDK on runner
if (!fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits')) {
const windows10SDKPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits');
if (!windows10SDKPathExists) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
the runner has a Windows 10 SDK installed in the default
location.`);
@ -1359,8 +1360,9 @@ class ValidateWindows {
}
static checkForVisualStudio() {
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
if (!(fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
const visualStudioInstallPathExists = fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');
const visualStudioDataPathExists = fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio');
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {
throw new Error(`Visual Studio not found at the default location.
Make sure the runner has Visual Studio installed in the
default location`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -32,9 +32,9 @@ class Action {
static get dockerfile() {
const currentPlatform = process.platform;
switch (currentPlatform) {
case "linux":
case 'linux':
return `${Action.actionFolder}/platforms/ubuntu/Dockerfile`;
case "win32":
case 'win32':
return `${Action.actionFolder}/platforms/windows/Dockerfile`;
default:
throw new Error(`No Dockerfile for currently unsupported platform: ${currentPlatform}`);

View File

@ -3,7 +3,7 @@ import { BuildParameters } from '..';
class ValidateWindows {
public static validate(buildParameters: BuildParameters) {
ValidateWindows.validateWindowsPlatformRequirements(buildParameters.platform)
ValidateWindows.validateWindowsPlatformRequirements(buildParameters.platform);
if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {
throw new Error(`Unity email and password must be set for Windows based builds to
authenticate the license. Make sure to set them inside UNITY_EMAIL
@ -33,7 +33,8 @@ class ValidateWindows {
private static checkForWin10SDK() {
//Check for Windows 10 SDK on runner
if (!fs.existsSync('C:/Program Files (x86)/Windows Kits')) {
const windows10SDKPathExists = fs.existsSync('C:/Program Files (x86)/Windows Kits');
if (!windows10SDKPathExists) {
throw new Error(`Windows 10 SDK not found in default location. Make sure
the runner has a Windows 10 SDK installed in the default
location.`);
@ -42,8 +43,10 @@ class ValidateWindows {
private static checkForVisualStudio() {
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
if (!(fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
const visualStudioInstallPathExists = fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');
const visualStudioDataPathExists = fs.existsSync('C:/ProgramData/Microsoft/VisualStudio');
if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {
throw new Error(`Visual Studio not found at the default location.
Make sure the runner has Visual Studio installed in the
default location`);