Skip to content
Snippets Groups Projects
Commit c55a414e authored by Tony Salomone's avatar Tony Salomone
Browse files

Fix crash if list_environments throws an error on startup

parent 4f2ad2a8
No related branches found
No related tags found
No related merge requests found
...@@ -195,13 +195,16 @@ export async function checkIfCondaEnvironmentExists() { ...@@ -195,13 +195,16 @@ export async function checkIfCondaEnvironmentExists() {
const command = '~/.transformerlab/src/install.sh list_environments'; const command = '~/.transformerlab/src/install.sh list_environments';
const { stdout, stderr } = await awaitExec(command, options).catch((err) => { 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 (stdout) console.log('stdout:', stdout);
if (stderr) console.error('stderr:', stderr); if (stderr) console.error('stderr:', stderr);
// search for the string "transformerlab" in the output // search for the string "transformerlab" in the output
if (stdout.includes('transformerlab')) { if (stdout && stdout.includes('transformerlab')) {
return true; return true;
} else { } else {
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment