Skip to content

Commit

Permalink
I. natcap#1675 wrap mamba cmd in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdenu4 committed Nov 4, 2024
1 parent c3a364b commit ad62ba8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workbench/src/main/setupAddRemovePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ export function setupAddPlugin() {
// Create a conda env containing the plugin and its dependencies
const envName = `invest_plugin_${pluginID}`;
const mamba = settingsStore.get('mamba');
execSync(`${mamba} create --yes --name ${envName} -c conda-forge "python<3.12" "gdal<3.6"`,
execSync(`"${mamba}" create --yes --name ${envName} -c conda-forge "python<3.12" "gdal<3.6"`,
{ stdio: 'inherit', windowsHide: true });
logger.info('created mamba env for plugin');
execSync(`${mamba} run --name ${envName} pip install "git+${pluginURL}"`,
execSync(`"${mamba}" run --name ${envName} pip install "git+${pluginURL}"`,
{ stdio: 'inherit', windowsHide: true });
logger.info('installed plugin into its env');

// Write plugin metadata to the workbench's config.json
const envInfo = execSync(`${mamba} info --envs`, { windowsHide: true }).toString();
const envInfo = execSync(`"${mamba}" info --envs`, { windowsHide: true }).toString();
logger.info(`env info:\n${envInfo}`);
const envPath = envInfo.match(`${envName}\\s+(.+)$`)[1];
logger.info(`env path:\n${envPath}`);
Expand Down Expand Up @@ -81,7 +81,7 @@ export function setupRemovePlugin() {
const env = settingsStore.get(`plugins.${pluginID}.env`);
const mamba = settingsStore.get('mamba');
execSync(
`${mamba} remove --yes --prefix ${env} --all`,
`"${mamba}" remove --yes --prefix ${env} --all`,
{ stdio: 'inherit' }
);
// Delete the plugin's data from storage
Expand Down

0 comments on commit ad62ba8

Please sign in to comment.