Skip to content

Commit

Permalink
Revert nullish coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKahr committed Feb 18, 2024
1 parent 08255b9 commit ae7ec67
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
30 changes: 15 additions & 15 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/model/build-parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class BuildParameters {
customParameters: Input.customParameters,
sshAgent: Input.sshAgent,
sshPublicKeysDirectoryPath: Input.sshPublicKeysDirectoryPath,
gitPrivateToken: Input.gitPrivateToken ?? (await GithubCliReader.GetGitHubAuthToken()),
gitPrivateToken: Input.gitPrivateToken || (await GithubCliReader.GetGitHubAuthToken()),
runAsHostUser: Input.runAsHostUser,
chownFilesTo: Input.chownFilesTo,
dockerCpuLimit: Input.dockerCpuLimit,
Expand All @@ -192,7 +192,7 @@ class BuildParameters {
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
cloudRunnerBranch: CloudRunnerOptions.cloudRunnerBranch.split('/').reverse()[0],
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,
awsStackName: CloudRunnerOptions.awsStackName,
gitSha: Input.gitSha,
Expand Down
26 changes: 13 additions & 13 deletions src/model/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,35 +186,35 @@ class Input {
}

static get sshPublicKeysDirectoryPath(): string {
return Input.getInput('sshPublicKeysDirectoryPath') ?? '';
return Input.getInput('sshPublicKeysDirectoryPath') || '';
}

static get gitPrivateToken(): string | undefined {
return Input.getInput('gitPrivateToken');
}

static get runAsHostUser(): string {
return Input.getInput('runAsHostUser')?.toLowerCase() ?? 'false';
return Input.getInput('runAsHostUser')?.toLowerCase() || 'false';
}

static get chownFilesTo() {
return Input.getInput('chownFilesTo') ?? '';
return Input.getInput('chownFilesTo') || '';
}

static get allowDirtyBuild(): boolean {
const input = Input.getInput('allowDirtyBuild') ?? false;
const input = Input.getInput('allowDirtyBuild') || false;

return input === 'true';
}

static get cacheUnityInstallationOnMac(): boolean {
const input = Input.getInput('cacheUnityInstallationOnMac') ?? false;
const input = Input.getInput('cacheUnityInstallationOnMac') || false;

return input === 'true';
}

static get unityHubVersionOnMac(): string {
const input = Input.getInput('unityHubVersionOnMac') ?? '';
const input = Input.getInput('unityHubVersionOnMac') || '';

return input !== '' ? input : '';
}
Expand All @@ -228,11 +228,11 @@ class Input {
}

static get dockerWorkspacePath(): string {
return Input.getInput('dockerWorkspacePath') ?? '/github/workspace';
return Input.getInput('dockerWorkspacePath') || '/github/workspace';
}

static get dockerCpuLimit(): string {
return Input.getInput('dockerCpuLimit') ?? os.cpus().length.toString();
return Input.getInput('dockerCpuLimit') || os.cpus().length.toString();
}

static get dockerMemoryLimit(): string {
Expand All @@ -252,24 +252,24 @@ class Input {
}

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 {
return Input.getInput('dockerIsolationMode') ?? 'default';
return Input.getInput('dockerIsolationMode') || 'default';
}

static get containerRegistryRepository(): string {
return Input.getInput('containerRegistryRepository') ?? 'unityci/editor';
return Input.getInput('containerRegistryRepository') || 'unityci/editor';
}

static get containerRegistryImageVersion(): string {
return Input.getInput('containerRegistryImageVersion') ?? '3';
return Input.getInput('containerRegistryImageVersion') || '3';
}

static get skipActivation(): string {
return Input.getInput('skipActivation')?.toLowerCase() ?? 'false';
return Input.getInput('skipActivation')?.toLowerCase() || 'false';
}

public static ToEnvVarFormat(input: string) {
Expand Down

0 comments on commit ae7ec67

Please sign in to comment.