forked from benchmark-action/github-action-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.js
More file actions
36 lines (32 loc) · 822 Bytes
/
Copy pathaction.js
File metadata and controls
36 lines (32 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* eslint @typescript-eslint/no-var-requires: 0 */
var exec = require('child_process').exec;
async function myexec(command, callback) {
console.log(command);
var cmd = await exec(command, function (err, stdout, stderr) {
if (err) {
console.error(err);
}
//console.log(cmd);
console.log(stdout);
callback();
});
}
function nop() {
return;
}
function actualScript(actionDir) {
require(`${actionDir}/dist/src/index.js`);
}
async function main() {
var origDir = process.cwd();
process.chdir(__dirname);
await myexec(`npm install`, async () => {
await myexec(`npm run build`, () => {
process.chdir(origDir);
actualScript(__dirname);
}).then(() => {
return;
});
});
}
main();