Skip to content

Commit

Permalink
Merge pull request #2311 from Chia-Network/cmj.fix-daemon-launch2
Browse files Browse the repository at this point in the history
`python .../venv/bin/chia` -> `.../venv/bin/chia`
  • Loading branch information
seeden authored Mar 22, 2024
2 parents 227a44f + 02d7340 commit c3e6838
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/gui/src/util/chiaEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const PY_DIST_EXECUTABLE = 'chia';
const PY_DIST_EXEC_ARGS = Object.freeze(['start', 'daemon']);

const PY_DEV_EXECUTABLE = `../../../venv/${process.platform === 'win32' ? 'Scripts/chia.exe' : 'bin/chia'}`;
const PY_DEV_EXEC_ARGS = Object.freeze([PY_DEV_EXECUTABLE, 'start', 'daemon']);
const PY_DEV_EXEC_ARGS = Object.freeze(['start', 'daemon']);

let pyProc = null;
let haveCert = null;
Expand Down Expand Up @@ -68,20 +68,26 @@ const startChiaDaemon = () => {
if (guessPackaged()) {
const executablePath = getExecutablePath(PY_DIST_EXECUTABLE);
console.info('Running python executable: ');
console.info(`Script: ${executablePath} ${PY_DIST_EXEC_ARGS.join(' ')}`);

try {
const Process = childProcess.spawn;
pyProc = new Process(executablePath, PY_DIST_EXEC_ARGS);
} catch (e) {
console.info('Running python executable: Error: ');
console.info(`Script: ${executablePath} ${PY_DIST_EXEC_ARGS.join(' ')}`);
console.error('Running python executable: Error: ');
console.error(e);
}
} else {
console.info('Running python script');
console.info(`Script: python ${PY_DEV_EXEC_ARGS.join(' ')}`);
console.info(`Script: ${PY_DEV_EXECUTABLE} ${PY_DEV_EXEC_ARGS.join(' ')}`);

const Process = childProcess.spawn;
pyProc = new Process('python', PY_DEV_EXEC_ARGS);
try {
const Process = childProcess.spawn;
pyProc = new Process(PY_DEV_EXECUTABLE, PY_DEV_EXEC_ARGS);
} catch (e) {
console.error('Running python script: Error: ');
console.error(e);
}
}

if (!pyProc) {
Expand Down

0 comments on commit c3e6838

Please sign in to comment.