增加依赖是否已经安装判断

This commit is contained in:
whyour
2023-07-10 23:48:05 +08:00
parent f3791cbb62
commit b69ff2895e
6 changed files with 105 additions and 44 deletions
+12
View File
@@ -399,6 +399,18 @@ export function promiseExec(command: string): Promise<string> {
});
}
export function promiseExecSuccess(command: string): Promise<string> {
return new Promise((resolve) => {
exec(
command,
{ maxBuffer: 200 * 1024 * 1024, encoding: 'utf8' },
(err, stdout, stderr) => {
resolve(stdout || '');
},
);
});
}
export function parseHeaders(headers: string) {
if (!headers) return {};