Skip to content

Commit

Permalink
Use platform-appropriate path separator
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMayes committed Apr 6, 2021
1 parent a89d539 commit 4609a7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5081,7 +5081,7 @@ function install(options) {
}
function run(options) {
return __awaiter(this, void 0, void 0, function () {
var bin, lib;
var bin, lib, ld, dyld;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
Expand All @@ -5096,8 +5096,10 @@ function run(options) {
bin = path.resolve(path.join(options.directory, "bin"));
lib = path.resolve(path.join(options.directory, "lib"));
core.addPath(bin);
core.exportVariable("LD_LIBRARY_PATH", lib + ":" + (process.env.LD_LIBRARY_PATH || ""));
core.exportVariable("DYLD_LIBRARY_PATH", lib + ":" + (process.env.DYLD_LIBRARY_PATH || ""));
ld = process.env.LD_LIBRARY_PATH;
dyld = process.env.DYLD_LIBRARY_PATH;
core.exportVariable("LD_LIBRARY_PATH", "" + lib + path.delimiter + ld);
core.exportVariable("DYLD_LIBRARY_PATH", "" + lib + path.delimiter + dyld);
return [2 /*return*/];
}
});
Expand Down
9 changes: 7 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,14 @@ async function run(options: Options): Promise<void> {

const bin = path.resolve(path.join(options.directory, "bin"));
const lib = path.resolve(path.join(options.directory, "lib"));

core.addPath(bin);
core.exportVariable("LD_LIBRARY_PATH", `${lib}:${process.env.LD_LIBRARY_PATH || ""}`);
core.exportVariable("DYLD_LIBRARY_PATH", `${lib}:${process.env.DYLD_LIBRARY_PATH || ""}`);

const ld = process.env.LD_LIBRARY_PATH;
const dyld = process.env.DYLD_LIBRARY_PATH;

core.exportVariable("LD_LIBRARY_PATH", `${lib}${path.delimiter}${ld}`);
core.exportVariable("DYLD_LIBRARY_PATH", `${lib}${path.delimiter}${dyld}`);
}

async function test(platform: string, options: Options): Promise<void> {
Expand Down

0 comments on commit 4609a7b

Please sign in to comment.