Skip to content

Commit 9280a69

Browse files
committed
Merge remote-tracking branch 'origin/develop' into fix_supersetVenvMacOS
2 parents f04f76b + 95aa2b3 commit 9280a69

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

main/utils/pythonEnv.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export async function installBundledPythonExecutable(mainWindow) {
372372
let userPath = getHomePath()
373373

374374
medomicsPath = path.join(userPath, ".medomics")
375-
pythonParentFolderExtractString = "-C " + medomicsPath
375+
pythonParentFolderExtractString = medomicsPath
376376
let pythonPath = path.join(medomicsPath, "python")
377377
// Check if the .medomics directory exists
378378
if (fs.existsSync(medomicsPath)) {
@@ -396,7 +396,7 @@ export async function installBundledPythonExecutable(mainWindow) {
396396
} else {
397397
bundledPythonPath = path.join(process.cwd(), "python")
398398
}
399-
pythonParentFolderExtractString = "-C " + bundledPythonPath.split("python")[0]
399+
pythonParentFolderExtractString = bundledPythonPath.split("python")[0]
400400
}
401401
// Check if the python executable is already installed
402402
let pythonExecutablePath = null
@@ -417,7 +417,7 @@ export async function installBundledPythonExecutable(mainWindow) {
417417
execCallbacksForChildWithNotifications(downloadPromise.child, "Python Downloading", mainWindow)
418418

419419
const { stdout, stderr } = await downloadPromise
420-
let extractCommand = `tar -xvf ${outputFileName} ${pythonParentFolderExtractString}`
420+
let extractCommand = `tar -xvf ${outputFileName} -C ${pythonParentFolderExtractString}`
421421
let extractionPromise = exec(extractCommand, { shell: "powershell.exe" })
422422
execCallbacksForChildWithNotifications(extractionPromise.child, "Python Exec. Extracting", mainWindow)
423423

@@ -442,7 +442,7 @@ export async function installBundledPythonExecutable(mainWindow) {
442442
}
443443

444444
let url = `https://github.com/indygreg/python-build-standalone/releases/download/20240224/${file}`
445-
let extractCommand = `tar -xvf ${file} ${pythonParentFolderExtractString}`
445+
let extractCommand = `tar -xvf ${file} -C ${pythonParentFolderExtractString}`
446446
let downloadPromise = exec(`/bin/bash -c "$(curl -fsSLO ${url})"`)
447447
execCallbacksForChildWithNotifications(downloadPromise.child, "Python Downloading", mainWindow)
448448
const { stdout, stderr } = await downloadPromise
@@ -473,18 +473,19 @@ export async function installBundledPythonExecutable(mainWindow) {
473473
}
474474

475475
let url = `https://github.com/indygreg/python-build-standalone/releases/download/20240224/${file}`
476-
let extractCommand = `tar -xvf ${file} ${pythonParentFolderExtractString}`
477476

478-
let downloadPromise = exec(`wget ${url}`)
477+
// Download the python executable
478+
let downloadPromise = exec(`wget ${url} -P ${pythonParentFolderExtractString}`)
479479
execCallbacksForChildWithNotifications(downloadPromise.child, "Python Downloading", mainWindow)
480480
const { stdout: download, stderr: downlaodErr } = await downloadPromise
481481
// Extract the python executable
482+
let extractCommand = `tar -xvf ${path.join(pythonParentFolderExtractString, file)} -C ${pythonParentFolderExtractString}`
482483
let extractionPromise = exec(extractCommand)
483484
execCallbacksForChildWithNotifications(extractionPromise.child, "Python Exec. Extracting", mainWindow)
484485
const { stdout: extrac, stderr: extracErr } = await extractionPromise
485486

486487
// Remove the downloaded file
487-
let removeCommand = `rm ${file}`
488+
let removeCommand = `rm ${path.join(pythonParentFolderExtractString, file)}`
488489
let removePromise = exec(removeCommand)
489490
execCallbacksForChildWithNotifications(removePromise.child, "Python Exec. Removing", mainWindow)
490491
const { stdout: remove, stderr: removeErr } = await removePromise

0 commit comments

Comments
 (0)