binhend 1.5.11 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/build-project.js +8 -0
- package/bin/commands/test-project.js +10 -0
- package/bin/index.js +2 -0
- package/bin/utils/cmdRun.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
const runCommand = require('../utils/cmdRun');
|
|
3
|
+
const cwdJoin = require('../utils/cwdJoin');
|
|
4
|
+
|
|
5
|
+
module.exports = (args) => {
|
|
6
|
+
// var projectFolder = args.shift() || './';
|
|
7
|
+
// var scriptPath = cwdJoin(projectFolder, 'test/test.js');
|
|
8
|
+
var testFolder = cwdJoin(projectFolder, 'test');
|
|
9
|
+
runCommand(`cd ${testFolder} & node test.js`);
|
|
10
|
+
};
|
package/bin/index.js
CHANGED
|
@@ -6,6 +6,8 @@ const commandMap = {
|
|
|
6
6
|
frontend: () => require('./commands/create-frontend'),
|
|
7
7
|
},
|
|
8
8
|
start: () => require('./commands/start-server'),
|
|
9
|
+
build: () => require('./commands/build-project'),
|
|
10
|
+
test: () => require('./commands/test-project'),
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
var command = commandMap,
|
package/bin/utils/cmdRun.js
CHANGED
|
@@ -11,7 +11,7 @@ function printErr(fullCommand, error) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
module.exports = function() {
|
|
14
|
-
const command = arguments[0], args = arguments[1],
|
|
14
|
+
const command = arguments[0], args = arguments[1] || [],
|
|
15
15
|
fullCommand = `${command} ${args.join(' ')}`,
|
|
16
16
|
|
|
17
17
|
printError = printErr.bind(null, fullCommand),
|