kempo 2.10.3 → 2.10.4
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/package.json +1 -1
- package/src/utils/cli.js +17 -1
package/package.json
CHANGED
package/src/utils/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
+
import readline from 'readline';
|
|
2
3
|
|
|
3
4
|
const args = {};
|
|
4
5
|
let win = {};
|
|
@@ -84,8 +85,23 @@ export const runChildNodeProcess = (scriptPath, argsObj = {}) => {
|
|
|
84
85
|
return runChildProcess(command);
|
|
85
86
|
};
|
|
86
87
|
|
|
88
|
+
export const promptUser = (query) => {
|
|
89
|
+
const rl = readline.createInterface({
|
|
90
|
+
input: process.stdin,
|
|
91
|
+
output: process.stdout
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return new Promise((resolve) => {
|
|
95
|
+
rl.question(query, (answer) => {
|
|
96
|
+
rl.close();
|
|
97
|
+
resolve(answer);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
87
102
|
export default {
|
|
88
103
|
getArgs,
|
|
89
104
|
runChildNodeProcess,
|
|
90
|
-
runChildNodeProcess
|
|
105
|
+
runChildNodeProcess,
|
|
106
|
+
promptUser
|
|
91
107
|
};
|