From 9de91d302130ded7b8da973c08eb4adb7d3d7e4b Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Tue, 4 Oct 2022 16:06:14 +0530 Subject: [PATCH] Open bash conditionally in the dev console on unix --- open_dev_console.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/open_dev_console.sh b/open_dev_console.sh index c254b748..e8ed0f05 100755 --- a/open_dev_console.sh +++ b/open_dev_console.sh @@ -1,9 +1,13 @@ #!/bin/bash -export SD_BASE_DIR=`pwd` -export MAMBA_ROOT_PREFIX="$SD_BASE_DIR/env/mamba" -export INSTALL_ENV_DIR="$SD_BASE_DIR/env/installer_env" +if [ "$0" == "bash" ]; then + export SD_BASE_DIR=`pwd` + export MAMBA_ROOT_PREFIX="$SD_BASE_DIR/env/mamba" + export INSTALL_ENV_DIR="$SD_BASE_DIR/env/installer_env" -eval "$($MAMBA_ROOT_PREFIX/micromamba shell hook -s posix)" + eval "$($MAMBA_ROOT_PREFIX/micromamba shell hook -s posix)" -micromamba activate "$INSTALL_ENV_DIR" + micromamba activate "$INSTALL_ENV_DIR" +else + bash --init-file open_dev_console.sh +fi \ No newline at end of file