Skip to content

Commit

Permalink
Ensure a missing imswitch installation is detected and fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Feb 3, 2024
1 parent 93dba13 commit 9e7cc06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,22 +516,24 @@ function downloadResources(win, fresh) {

function setupMambaEnv(win) {
const envName = "imswitch";
var miniforgePath, mambaPath, pipPath;
var miniforgePath, mambaPath, pipPath, imswitchPath;

if (os.platform == "win32") {
miniforgePath = path.join(homeDir, 'miniforge');
mambaPath = path.join(miniforgePath, 'condabin', 'mamba');
pipPath = path.join(miniforgePath, 'Scripts', 'pip'); // Adjust for Windows if necessary
imswitchPath = path.join(miniforgePath, 'site-packages', 'imswitch')
}
else {
miniforgePath = path.join(homeDir, 'miniforge');
mambaPath = path.join(miniforgePath, 'bin', 'mamba');
pipPath = path.join(miniforgePath, 'bin', 'pip');
imswitchPath = path.join(miniforgePath, 'site-packages', 'imswitch')
}
/*
Install UC2-REST and ImSwitch from github master
*/
if (!fs.existsSync(path.join(miniforgePath))) {
if (!fs.existsSync(path.join(miniforgePath)) || !fs.existsSync(path.join(imswitchPath))) {
// win.webContents.send("updateStatus", "Creating Mamba environment...");
// runCommand(`${mambaPath}`, [`create`, `-n`, `${envName}`, '-y'], win)
//runCommand(`${mambaPath} create -n ${envName} -y`)
Expand Down

0 comments on commit 9e7cc06

Please sign in to comment.