@whyour/qinglong 0.8.0 → 0.8.1
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/static/build/config/util.js +16 -12
package/package.json
CHANGED
|
@@ -383,20 +383,24 @@ function emptyDir(path) {
|
|
|
383
383
|
fs.rmdirSync(path);
|
|
384
384
|
}
|
|
385
385
|
exports.emptyDir = emptyDir;
|
|
386
|
-
function promiseExec(command) {
|
|
387
|
-
|
|
388
|
-
(0, child_process_1.exec)(command, { maxBuffer: 200 * 1024 * 1024, encoding: 'utf8' }
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
386
|
+
async function promiseExec(command) {
|
|
387
|
+
try {
|
|
388
|
+
const { stderr, stdout } = await (0, util_1.promisify)(child_process_1.exec)(command, { maxBuffer: 200 * 1024 * 1024, encoding: 'utf8' });
|
|
389
|
+
return stdout || stderr;
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
return JSON.stringify(error);
|
|
393
|
+
}
|
|
392
394
|
}
|
|
393
395
|
exports.promiseExec = promiseExec;
|
|
394
|
-
function promiseExecSuccess(command) {
|
|
395
|
-
|
|
396
|
-
(0, child_process_1.exec)(command, { maxBuffer: 200 * 1024 * 1024, encoding: 'utf8' }
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
396
|
+
async function promiseExecSuccess(command) {
|
|
397
|
+
try {
|
|
398
|
+
const { stdout } = await (0, util_1.promisify)(child_process_1.exec)(command, { maxBuffer: 200 * 1024 * 1024, encoding: 'utf8' });
|
|
399
|
+
return stdout || '';
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
return '';
|
|
403
|
+
}
|
|
400
404
|
}
|
|
401
405
|
exports.promiseExecSuccess = promiseExecSuccess;
|
|
402
406
|
function parseHeaders(headers) {
|