Skip to content

Commit

Permalink
working-directory input
Browse files Browse the repository at this point in the history
  • Loading branch information
enniel committed Oct 17, 2021
1 parent d5b7dec commit 2880010
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5452,6 +5452,24 @@ function run() {
if (process.platform !== "darwin" && process.platform !== "linux") {
throw new Error("Unsupported virtual machine: please use either macos or ubuntu VM.");
}
// custom working directory
const workingDirectoryInput = core.getInput("working-directory");
if (workingDirectoryInput) {
console.log(`custom working directory: ${workingDirectoryInput}`);
}
const workingDirectory = !workingDirectoryInput
? undefined
: workingDirectoryInput;
// execute the custom script
try {
// move to custom working directory if set
if (workingDirectory) {
process.chdir(workingDirectory);
}
}
catch (error) {
core.setFailed(error.message);
}
const bundleToolPath = `${process.env.HOME}/bundletool`;
const bundleToolFile = `${bundleToolPath}/bundletool.jar`;
yield io.mkdirP(bundleToolPath);
Expand Down
19 changes: 19 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ async function run() {
);
}

// custom working directory
const workingDirectoryInput = core.getInput("working-directory");
if (workingDirectoryInput) {
console.log(`custom working directory: ${workingDirectoryInput}`);
}
const workingDirectory = !workingDirectoryInput
? undefined
: workingDirectoryInput;

// execute the custom script
try {
// move to custom working directory if set
if (workingDirectory) {
process.chdir(workingDirectory);
}
} catch (error: any) {
core.setFailed(error.message);
}

const bundleToolPath = `${process.env.HOME}/bundletool`;
const bundleToolFile = `${bundleToolPath}/bundletool.jar`;

Expand Down

0 comments on commit 2880010

Please sign in to comment.