Revert nullish coalescing operator

pull/629/head
Andrew Kahr 2024-02-18 02:06:28 -08:00
parent 08255b9bb8
commit ae7ec67e88
4 changed files with 31 additions and 31 deletions

30
dist/index.js generated vendored
View File

@ -316,7 +316,7 @@ class BuildParameters {
customParameters: input_1.default.customParameters, customParameters: input_1.default.customParameters,
sshAgent: input_1.default.sshAgent, sshAgent: input_1.default.sshAgent,
sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath, sshPublicKeysDirectoryPath: input_1.default.sshPublicKeysDirectoryPath,
gitPrivateToken: input_1.default.gitPrivateToken ?? (await github_cli_1.GithubCliReader.GetGitHubAuthToken()), gitPrivateToken: input_1.default.gitPrivateToken || (await github_cli_1.GithubCliReader.GetGitHubAuthToken()),
runAsHostUser: input_1.default.runAsHostUser, runAsHostUser: input_1.default.runAsHostUser,
chownFilesTo: input_1.default.chownFilesTo, chownFilesTo: input_1.default.chownFilesTo,
dockerCpuLimit: input_1.default.dockerCpuLimit, dockerCpuLimit: input_1.default.dockerCpuLimit,
@ -338,7 +338,7 @@ class BuildParameters {
branch: input_1.default.branch.replace('/head', '') || (await git_repo_1.GitRepoReader.GetBranch()), branch: input_1.default.branch.replace('/head', '') || (await git_repo_1.GitRepoReader.GetBranch()),
cloudRunnerBranch: cloud_runner_options_1.default.cloudRunnerBranch.split('/').reverse()[0], cloudRunnerBranch: cloud_runner_options_1.default.cloudRunnerBranch.split('/').reverse()[0],
cloudRunnerDebug: cloud_runner_options_1.default.cloudRunnerDebug, cloudRunnerDebug: cloud_runner_options_1.default.cloudRunnerDebug,
githubRepo: (input_1.default.githubRepo ?? (await git_repo_1.GitRepoReader.GetRemote())) || 'game-ci/unity-builder', githubRepo: input_1.default.githubRepo || (await git_repo_1.GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
isCliMode: cli_1.Cli.isCliMode, isCliMode: cli_1.Cli.isCliMode,
awsStackName: cloud_runner_options_1.default.awsStackName, awsStackName: cloud_runner_options_1.default.awsStackName,
gitSha: input_1.default.gitSha, gitSha: input_1.default.gitSha,
@ -7019,27 +7019,27 @@ class Input {
return Input.getInput('sshAgent') || ''; return Input.getInput('sshAgent') || '';
} }
static get sshPublicKeysDirectoryPath() { static get sshPublicKeysDirectoryPath() {
return Input.getInput('sshPublicKeysDirectoryPath') ?? ''; return Input.getInput('sshPublicKeysDirectoryPath') || '';
} }
static get gitPrivateToken() { static get gitPrivateToken() {
return Input.getInput('gitPrivateToken'); return Input.getInput('gitPrivateToken');
} }
static get runAsHostUser() { static get runAsHostUser() {
return Input.getInput('runAsHostUser')?.toLowerCase() ?? 'false'; return Input.getInput('runAsHostUser')?.toLowerCase() || 'false';
} }
static get chownFilesTo() { static get chownFilesTo() {
return Input.getInput('chownFilesTo') ?? ''; return Input.getInput('chownFilesTo') || '';
} }
static get allowDirtyBuild() { static get allowDirtyBuild() {
const input = Input.getInput('allowDirtyBuild') ?? false; const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true'; return input === 'true';
} }
static get cacheUnityInstallationOnMac() { static get cacheUnityInstallationOnMac() {
const input = Input.getInput('cacheUnityInstallationOnMac') ?? false; const input = Input.getInput('cacheUnityInstallationOnMac') || false;
return input === 'true'; return input === 'true';
} }
static get unityHubVersionOnMac() { static get unityHubVersionOnMac() {
const input = Input.getInput('unityHubVersionOnMac') ?? ''; const input = Input.getInput('unityHubVersionOnMac') || '';
return input !== '' ? input : ''; return input !== '' ? input : '';
} }
static get unitySerial() { static get unitySerial() {
@ -7049,10 +7049,10 @@ class Input {
return Input.getInput('UNITY_LICENSE'); return Input.getInput('UNITY_LICENSE');
} }
static get dockerWorkspacePath() { static get dockerWorkspacePath() {
return Input.getInput('dockerWorkspacePath') ?? '/github/workspace'; return Input.getInput('dockerWorkspacePath') || '/github/workspace';
} }
static get dockerCpuLimit() { static get dockerCpuLimit() {
return Input.getInput('dockerCpuLimit') ?? node_os_1.default.cpus().length.toString(); return Input.getInput('dockerCpuLimit') || node_os_1.default.cpus().length.toString();
} }
static get dockerMemoryLimit() { static get dockerMemoryLimit() {
const bytesInMegabyte = 1024 * 1024; const bytesInMegabyte = 1024 * 1024;
@ -7068,19 +7068,19 @@ class Input {
memoryMultiplier = 0.75; memoryMultiplier = 0.75;
break; break;
} }
return (Input.getInput('dockerMemoryLimit') ?? `${Math.floor((node_os_1.default.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`); return (Input.getInput('dockerMemoryLimit') || `${Math.floor((node_os_1.default.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`);
} }
static get dockerIsolationMode() { static get dockerIsolationMode() {
return Input.getInput('dockerIsolationMode') ?? 'default'; return Input.getInput('dockerIsolationMode') || 'default';
} }
static get containerRegistryRepository() { static get containerRegistryRepository() {
return Input.getInput('containerRegistryRepository') ?? 'unityci/editor'; return Input.getInput('containerRegistryRepository') || 'unityci/editor';
} }
static get containerRegistryImageVersion() { static get containerRegistryImageVersion() {
return Input.getInput('containerRegistryImageVersion') ?? '3'; return Input.getInput('containerRegistryImageVersion') || '3';
} }
static get skipActivation() { static get skipActivation() {
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false'; return Input.getInput('skipActivation')?.toLowerCase() || 'false';
} }
static ToEnvVarFormat(input) { static ToEnvVarFormat(input) {
if (input.toUpperCase() === input) { if (input.toUpperCase() === input) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -170,7 +170,7 @@ class BuildParameters {
customParameters: Input.customParameters, customParameters: Input.customParameters,
sshAgent: Input.sshAgent, sshAgent: Input.sshAgent,
sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath, sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath,
gitPrivateToken: Input.gitPrivateToken ?? (await GithubCliReader.GetGitHubAuthToken()), gitPrivateToken: Input.gitPrivateToken || (await GithubCliReader.GetGitHubAuthToken()),
runAsHostUser: Input.runAsHostUser, runAsHostUser: Input.runAsHostUser,
chownFilesTo: Input.chownFilesTo, chownFilesTo: Input.chownFilesTo,
dockerCpuLimit: Input.dockerCpuLimit, dockerCpuLimit: Input.dockerCpuLimit,
@ -192,7 +192,7 @@ class BuildParameters {
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()), branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
cloudRunnerBranch: CloudRunnerOptions.cloudRunnerBranch.split('/').reverse()[0], cloudRunnerBranch: CloudRunnerOptions.cloudRunnerBranch.split('/').reverse()[0],
cloudRunnerDebug: CloudRunnerOptions.cloudRunnerDebug, cloudRunnerDebug: CloudRunnerOptions.cloudRunnerDebug,
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || 'game-ci/unity-builder', githubRepo: Input.githubRepo || (await GitRepoReader.GetRemote()) || 'game-ci/unity-builder',
isCliMode: Cli.isCliMode, isCliMode: Cli.isCliMode,
awsStackName: CloudRunnerOptions.awsStackName, awsStackName: CloudRunnerOptions.awsStackName,
gitSha: Input.gitSha, gitSha: Input.gitSha,

View File

@ -186,7 +186,7 @@ class Input {
} }
static get sshPublicKeysDirectoryPath(): string { static get sshPublicKeysDirectoryPath(): string {
return Input.getInput('sshPublicKeysDirectoryPath') ?? ''; return Input.getInput('sshPublicKeysDirectoryPath') || '';
} }
static get gitPrivateToken(): string | undefined { static get gitPrivateToken(): string | undefined {
@ -194,27 +194,27 @@ class Input {
} }
static get runAsHostUser(): string { static get runAsHostUser(): string {
return Input.getInput('runAsHostUser')?.toLowerCase() ?? 'false'; return Input.getInput('runAsHostUser')?.toLowerCase() || 'false';
} }
static get chownFilesTo() { static get chownFilesTo() {
return Input.getInput('chownFilesTo') ?? ''; return Input.getInput('chownFilesTo') || '';
} }
static get allowDirtyBuild(): boolean { static get allowDirtyBuild(): boolean {
const input = Input.getInput('allowDirtyBuild') ?? false; const input = Input.getInput('allowDirtyBuild') || false;
return input === 'true'; return input === 'true';
} }
static get cacheUnityInstallationOnMac(): boolean { static get cacheUnityInstallationOnMac(): boolean {
const input = Input.getInput('cacheUnityInstallationOnMac') ?? false; const input = Input.getInput('cacheUnityInstallationOnMac') || false;
return input === 'true'; return input === 'true';
} }
static get unityHubVersionOnMac(): string { static get unityHubVersionOnMac(): string {
const input = Input.getInput('unityHubVersionOnMac') ?? ''; const input = Input.getInput('unityHubVersionOnMac') || '';
return input !== '' ? input : ''; return input !== '' ? input : '';
} }
@ -228,11 +228,11 @@ class Input {
} }
static get dockerWorkspacePath(): string { static get dockerWorkspacePath(): string {
return Input.getInput('dockerWorkspacePath') ?? '/github/workspace'; return Input.getInput('dockerWorkspacePath') || '/github/workspace';
} }
static get dockerCpuLimit(): string { static get dockerCpuLimit(): string {
return Input.getInput('dockerCpuLimit') ?? os.cpus().length.toString(); return Input.getInput('dockerCpuLimit') || os.cpus().length.toString();
} }
static get dockerMemoryLimit(): string { static get dockerMemoryLimit(): string {
@ -252,24 +252,24 @@ class Input {
} }
return ( return (
Input.getInput('dockerMemoryLimit') ?? `${Math.floor((os.totalmem() / bytesInMegabyte) * memoryMultiplier)}m` Input.getInput('dockerMemoryLimit') || `${Math.floor((os.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`
); );
} }
static get dockerIsolationMode(): string { static get dockerIsolationMode(): string {
return Input.getInput('dockerIsolationMode') ?? 'default'; return Input.getInput('dockerIsolationMode') || 'default';
} }
static get containerRegistryRepository(): string { static get containerRegistryRepository(): string {
return Input.getInput('containerRegistryRepository') ?? 'unityci/editor'; return Input.getInput('containerRegistryRepository') || 'unityci/editor';
} }
static get containerRegistryImageVersion(): string { static get containerRegistryImageVersion(): string {
return Input.getInput('containerRegistryImageVersion') ?? '3'; return Input.getInput('containerRegistryImageVersion') || '3';
} }
static get skipActivation(): string { static get skipActivation(): string {
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false'; return Input.getInput('skipActivation')?.toLowerCase() || 'false';
} }
public static ToEnvVarFormat(input: string) { public static ToEnvVarFormat(input: string) {