detox-cli 18.0.0 → 19.0.0
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/cli.js +18 -10
- package/package.json +8 -15
package/cli.js
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
const cp = require('child_process');
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const chalk = require('chalk');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @param {string} msg
|
|
9
|
+
*/
|
|
10
|
+
function log(msg) {
|
|
11
|
+
console.error(chalk.red(msg));
|
|
12
|
+
}
|
|
5
13
|
|
|
6
14
|
function main([_$0, _detox, ...cliArgs]) {
|
|
7
15
|
const [command] = cliArgs;
|
|
@@ -19,11 +27,11 @@ function spawnDetoxBinary(cliArgs) {
|
|
|
19
27
|
const binaryPath = path.join(nodeBinariesPath, `detox${isWin32 ? '.cmd' : ''}`);
|
|
20
28
|
|
|
21
29
|
if (!fs.existsSync(binaryPath)) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
log(`Failed to find Detox executable at path: ${binaryPath}`);
|
|
31
|
+
log(`\nPossible solutions:`);
|
|
32
|
+
log(`1. Make sure your current working directory is correct.`);
|
|
33
|
+
log(`2. Run "npm install" to ensure your "node_modules" directory is up-to-date.`);
|
|
34
|
+
log(`3. Run "npm install detox --save-dev" for the fresh Detox installation in your project.\n`);
|
|
27
35
|
|
|
28
36
|
return 1;
|
|
29
37
|
}
|
|
@@ -49,13 +57,13 @@ function spawnRecorder([_recorder, ...recorderArgs]) {
|
|
|
49
57
|
const detoxRecorderPath = path.join(process.cwd(), 'node_modules/detox-recorder');
|
|
50
58
|
const detoxRecorderCLIPath = path.join(detoxRecorderPath, 'DetoxRecorderCLI');
|
|
51
59
|
|
|
52
|
-
if (fs.existsSync(detoxRecorderCLIPath)) {
|
|
53
|
-
|
|
54
|
-
return result.status;
|
|
55
|
-
} else {
|
|
56
|
-
console.log(`Detox Recorder is not installed in this directory: ${detoxRecorderPath}`);
|
|
60
|
+
if (!fs.existsSync(detoxRecorderCLIPath)) {
|
|
61
|
+
log(`Detox Recorder is not installed in this directory: ${detoxRecorderPath}`);
|
|
57
62
|
return 1;
|
|
58
63
|
}
|
|
64
|
+
|
|
65
|
+
const result = cp.spawnSync(detoxRecorderCLIPath, recorderArgs, { stdio: 'inherit' });
|
|
66
|
+
return result.status;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
69
|
function findPathKey() {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "detox-cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
|
+
"description": "Optional wrapper for Detox CLI, meant to be installed globally",
|
|
5
|
+
"main": "cli.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": ":"
|
|
8
8
|
},
|
|
@@ -17,21 +17,14 @@
|
|
|
17
17
|
"detox",
|
|
18
18
|
"cli"
|
|
19
19
|
],
|
|
20
|
-
"author": "
|
|
20
|
+
"author": "Yaroslav Serhieiev <yaroslavs@wix.com>",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"bugs": {
|
|
23
|
-
"url": "https://github.com/wix/
|
|
23
|
+
"url": "https://github.com/wix/Detox/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"minimist": "^1.2.0"
|
|
26
|
+
"chalk": "^4.0.0"
|
|
28
27
|
},
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
"homepage": "https://github.com/wix/detox#readme",
|
|
33
|
-
"jest": {
|
|
34
|
-
"verbose": true
|
|
35
|
-
},
|
|
36
|
-
"gitHead": "7a9a6e1ac82088d6e96fe86d41a9a119b02d9dbd"
|
|
28
|
+
"homepage": "https://github.com/wix/Detox",
|
|
29
|
+
"gitHead": "747ed2be8419829de11a1ef8736fd732eb3bc647"
|
|
37
30
|
}
|