Skip to content

Commit

Permalink
switch some to spawnSync
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Oct 24, 2024
1 parent fc2faf6 commit ab954e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/todesktop/beforeInstall.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions scripts/todesktop/postInstall.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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();
Expand All @@ -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");
}
Expand Down

0 comments on commit ab954e6

Please sign in to comment.