From ab954e6280c2bdc60ff16dfed4be496a6e199fe5 Mon Sep 17 00:00:00 2001 From: Kendal Cormany Date: Thu, 24 Oct 2024 16:49:21 -0700 Subject: [PATCH] switch some to spawnSync --- scripts/todesktop/beforeInstall.js | 6 +++--- scripts/todesktop/postInstall.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/todesktop/beforeInstall.js b/scripts/todesktop/beforeInstall.js index 19c8bc97..288baf58 100644 --- a/scripts/todesktop/beforeInstall.js +++ b/scripts/todesktop/beforeInstall.js @@ -1,4 +1,4 @@ -const { exec, execSync } = require("child_process"); +const { exec, execSync, spawnSync } = require("child_process"); const path = require("path"); const os = require('os'); @@ -24,9 +24,9 @@ module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => { if (os.platform() === "win32") { - const result1 = execSync('curl -s https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe',execOutput).toString(); + const result1 = spawnSync('curl' ,['-s', 'https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe'],{shell:true,stdio: 'inherit'},execOutput).toString(); console.log(result1); - const result2 = execSync('./python-3.12.7-amd64.exe /quiet PrependPath=1 Include_test=0',execOutput).toString(); + const result2 = spawnSync('./python-3.12.7-amd64.exe', ['/quiet', 'PrependPath=1', 'Include_test=0'],{shell:true,stdio: 'inherit'},execOutput).toString(); console.log(result2); const result3 = execSync(`python --version`,execOutput).toString(); console.log(result3); diff --git a/scripts/todesktop/postInstall.js b/scripts/todesktop/postInstall.js index e71d09b4..1746bd97 100644 --- a/scripts/todesktop/postInstall.js +++ b/scripts/todesktop/postInstall.js @@ -1,4 +1,4 @@ -const { exec, execSync } = require("child_process"); +const { exec, execSync, spawnSync } = require("child_process"); const path = require("path"); const os = require('os'); const process = require("process"); @@ -35,9 +35,9 @@ async function postInstall() { console.log("win ver"); const result1 = execSync(`python --version`,execOutput).toString(); console.log(result1); - const result4 = execSync(`python -3.12 -m pip install --upgrade pip`).toString(); + const result4 = spawnSync(`python`, ['-3.12', '-m', 'pip' ,'install' ,'--upgrade pip'],{shell:true,stdio: 'inherit'}).toString(); console.log(result4); - const result2 = execSync(`python -3.12 -m pip install comfy-cli`, execOutput).toString(); + const result2 = spawnSync(`python`, ['-3.12 ','-m' ,'pip' ,'install comfy-cli'], {shell:true,stdio: 'inherit'}).toString(); console.log(result2); console.log("finish pip"); const result3 = execSync(`yarn run make:assets:nvidia`, execOutput).toString(); @@ -48,7 +48,7 @@ async function postInstall() { if (os.platform() === "darwin") { console.log("mac ver"); - const result = execSync(`sh ${path.join(dirPath, 'scripts', 'signPython.sh')}`, execOutput).toString(); + const result = spawnSync('sh', [path.join(dirPath, 'scripts', 'signPython.sh')],{shell:true,stdio: 'inherit'}).toString(); console.log(result); console.log("finish python"); }