forked from JS-DevTools/npm-publish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexec.js
37 lines (32 loc) · 871 Bytes
/
exec.js
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
37
"use strict";
const chai = require("chai");
const chaiExec = require("@jsdevtools/chai-exec");
const paths = require("./paths");
chai.use(chaiExec);
module.exports = {
/**
* Executes the GitHub Action with the specified options
*/
action (options) {
// Deep merge the options object, since Chai Exec only does a shallow merge
options = {
cwd: paths.workspace,
...options,
env: {
...process.env,
NODE_OPTIONS: "",
INPUT_REGISTRY: "https://registry.npmjs.org/",
INPUT_PACKAGE: "package.json",
"INPUT_CHECK-VERSION": "true",
...options.env,
}
};
return chaiExec("node", [paths.action], options);
},
/**
* Executes the CLI with the specified arguments
*/
cli (...args) {
return chaiExec("node", [paths.cli].concat(args), { cwd: paths.workspace });
},
};