Skip to content

Commit

Permalink
Fix crash if list_environments throws an error on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
dadmobile committed Mar 7, 2024
1 parent 4f2ad2a commit c55a414
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,16 @@ export async function checkIfCondaEnvironmentExists() {
const command = '~/.transformerlab/src/install.sh list_environments';

const { stdout, stderr } = await awaitExec(command, options).catch((err) => {
console.log('Error running conda env list', err);
return {
stdout: false,
stderr: err
};
});
if (stdout) console.log('stdout:', stdout);
if (stderr) console.error('stderr:', stderr);

// search for the string "transformerlab" in the output
if (stdout.includes('transformerlab')) {
if (stdout && stdout.includes('transformerlab')) {
return true;
} else {
return false;
Expand Down

0 comments on commit c55a414

Please sign in to comment.