Clarify validating logic with explicit variables

This commit is contained in:
Pierre L 2024-03-18 11:04:27 +01:00
parent 5724777f70
commit e7544d8753
3 changed files with 6 additions and 1 deletions

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -4,7 +4,12 @@ import { BuildParameters } from '..';
class ValidateWindows { class ValidateWindows {
public static validate(buildParameters: BuildParameters) { public static validate(buildParameters: BuildParameters) {
ValidateWindows.validateWindowsPlatformRequirements(buildParameters.targetPlatform); ValidateWindows.validateWindowsPlatformRequirements(buildParameters.targetPlatform);
if (!((process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD) || buildParameters.unityLicensingServer)) {
const { unityLicensingServer } = buildParameters;
const hasLicensingCredentials = process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD;
const hasValidLicensingStrategy = hasLicensingCredentials || unityLicensingServer;
if (!hasValidLicensingStrategy) {
throw new Error(`Unity email and password or alternatively a Unity licensing server url must be set for throw new Error(`Unity email and password or alternatively a Unity licensing server url must be set for
Windows based builds to authenticate the license. Make sure to set them inside UNITY_EMAIL Windows based builds to authenticate the license. Make sure to set them inside UNITY_EMAIL
and UNITY_PASSWORD in Github Secrets and pass them into the environment.`); and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);