Skip to content

Commit

Permalink
Expose esyPrefix so that other steps/jobs can use it
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed Jun 27, 2024
1 parent e36b081 commit bd1cc8c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176072,6 +176072,10 @@ const manifestKey = core.getInput("manifest");
const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
const customPostInstallJS = core.getInput("postinstall-js");
function appendEnvironmentFile(key, value) {
let filename = process.env.GITHUB_OUTPUT;
external_fs_.appendFileSync(filename, `${key}=${value}\n`);
}
function run(name, command, args) {
return __awaiter(this, void 0, void 0, function* () {
const PATH = process.env.PATH ? process.env.PATH : "";
Expand Down Expand Up @@ -176099,6 +176103,10 @@ function main() {
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
9 changes: 9 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const prepareNPMArtifactsMode = core.getInput("prepare-npm-artifacts-mode");
const bundleNPMArtifactsMode = core.getInput("bundle-npm-artifacts-mode");
const customPostInstallJS = core.getInput("postinstall-js");

function appendEnvironmentFile(key: string, value: string) {
let filename = process.env.GITHUB_OUTPUT!;
fs.appendFileSync(filename, `${key}=${value}\n`);
}

async function run(name: string, command: string, args: string[]) {
const PATH = process.env.PATH ? process.env.PATH : "";
core.startGroup(name);
Expand Down Expand Up @@ -51,6 +56,10 @@ async function main() {
),
".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 bd1cc8c

Please sign in to comment.