Skip to content

Commit

Permalink
initialise esyPrefix early on
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed Jul 13, 2024
1 parent a843d39 commit d28defb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
22 changes: 11 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180477,6 +180477,17 @@ function main() {
return __awaiter(this, void 0, void 0, function* () {
const workingDirectory = core.getInput("working-directory") || process.cwd();
try {
esyPrefix =
esyPrefix && esyPrefix !== ""
? esyPrefix
: external_path_.join(external_path_.dirname(process.env.GITHUB_WORKSPACE ||
process.env.HOME ||
process.env.HOMEPATH ||
"~"), ".esy");
console.log("esy-prefix", esyPrefix);
const ghOutputEsyPrefixK = "ESY_PREFIX";
console.log(`Setting ${ghOutputEsyPrefixK} to`, esyPrefix);
appendEnvironmentFile(ghOutputEsyPrefixK, esyPrefix);
if (setupEsy) {
let tarballUrl, checksum, esyPackageVersion, esyPackageName;
if (!setupEsyVersion || !setupEsyShaSum || !setupEsyTarball) {
Expand Down Expand Up @@ -180520,17 +180531,6 @@ function main() {
}
external_fs_.statSync(workingDirectory);
process.chdir(workingDirectory);
esyPrefix =
esyPrefix && esyPrefix !== ""
? esyPrefix
: external_path_.join(external_path_.dirname(process.env.GITHUB_WORKSPACE ||
process.env.HOME ||
process.env.HOMEPATH ||
"~"), ".esy");
console.log("esy-prefix", esyPrefix);
const ghOutputEsyPrefixK = "ESY_PREFIX";
console.log(`Setting ${ghOutputEsyPrefixK} to`, esyPrefix);
appendEnvironmentFile(ghOutputEsyPrefixK, esyPrefix);
const installPath = [`${esyPrefix}/source`];
const installKey = `source-${index_platform}-${arch}-${sourceCacheKey}`;
core.startGroup("Restoring install cache");
Expand Down
33 changes: 16 additions & 17 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ const arch = os.arch();
async function main() {
const workingDirectory = core.getInput("working-directory") || process.cwd();
try {
esyPrefix =
esyPrefix && esyPrefix !== ""
? esyPrefix
: path.join(
path.dirname(
process.env.GITHUB_WORKSPACE ||
process.env.HOME ||
process.env.HOMEPATH ||
"~"
),
".esy"
);
console.log("esy-prefix", esyPrefix);
const ghOutputEsyPrefixK = "ESY_PREFIX";
console.log(`Setting ${ghOutputEsyPrefixK} to`, esyPrefix);
appendEnvironmentFile(ghOutputEsyPrefixK, esyPrefix);
if (setupEsy) {
let tarballUrl, checksum, esyPackageVersion, esyPackageName;
if (!setupEsyVersion || !setupEsyShaSum || !setupEsyTarball) {
Expand Down Expand Up @@ -182,23 +198,6 @@ async function main() {
}
fs.statSync(workingDirectory);
process.chdir(workingDirectory);

esyPrefix =
esyPrefix && esyPrefix !== ""
? esyPrefix
: path.join(
path.dirname(
process.env.GITHUB_WORKSPACE ||
process.env.HOME ||
process.env.HOMEPATH ||
"~"
),
".esy"
);
console.log("esy-prefix", esyPrefix);
const ghOutputEsyPrefixK = "ESY_PREFIX";
console.log(`Setting ${ghOutputEsyPrefixK} to`, esyPrefix);
appendEnvironmentFile(ghOutputEsyPrefixK, esyPrefix);
const installPath = [`${esyPrefix}/source`];
const installKey = `source-${platform}-${arch}-${sourceCacheKey}`;
core.startGroup("Restoring install cache");
Expand Down

0 comments on commit d28defb

Please sign in to comment.