Skip to content

Commit

Permalink
restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
afujiwara-roblox committed Mar 5, 2024
1 parent 0766e15 commit cdf0071
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ async function run(): Promise<void> {
await exec("chmod +x .foreman-install/foreman");
}

if ((artifactoryUrl == "") != (artifactoryToken == "")) {
await foreman.authenticate(githubToken);

if (artifactoryUrl != "" && artifactoryToken != "") { // both defined
await foreman.addArtifactoryToken(artifactoryUrl, artifactoryToken);
} else if (artifactoryUrl != "" || artifactoryToken != "") { // only one defined
throw new Error(
"Both artifactory-url and artifactory-token must be set or null"
);
}

await foreman.authenticate(githubToken);
await foreman.addArtifactoryToken(artifactoryUrl, artifactoryToken);
foreman.addBinDirToPath();

if (workingDir !== undefined && workingDir !== null && workingDir !== "") {
Expand Down

0 comments on commit cdf0071

Please sign in to comment.