Skip to content

Commit

Permalink
Update mac_run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
x-CK-x authored Dec 10, 2024
1 parent 5978da9 commit e6009ed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mac_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ if ! command -v conda >/dev/null 2>&1; then
rm miniconda.sh
export PATH="$HOME/miniconda/bin:$PATH"
conda init bash >> debug.log 2>&1 || true
# shellcheck source=/dev/null
source ~/.bashrc

echo "Miniconda installed successfully"
Expand All @@ -68,7 +67,6 @@ else
echo "Miniconda is already installed"
echo "Miniconda is already installed" >> debug.log
export PATH="$HOME/miniconda/bin:$PATH"
# shellcheck source=/dev/null
source ~/.bashrc
fi

Expand All @@ -78,14 +76,17 @@ echo "Checking repository path..." >> debug.log
if [ -f "$PATHFILE" ]; then
echo "Found stored path in $PATHFILE"
echo "Found stored path in $PATHFILE" >> debug.log
STORED_PATH=$(<"$PATHFILE")

STORED_PATH=$(sed -e 's/^[[:space:]]*//;s/[[:space:]]*$//' "$PATHFILE")

if [ -z "$STORED_PATH" ]; then
echo "Stored path is empty. Please delete $PATHFILE and run again."
echo "Stored path is empty. Please delete $PATHFILE and run again." >> debug.log
echo "Press any key to exit."
read -rsn1
exit 1
fi

cd "$STORED_PATH" >> debug.log 2>&1
if [ $? -ne 0 ]; then
echo "Failed to change directory to stored path: $STORED_PATH"
Expand All @@ -99,6 +100,7 @@ if [ -f "$PATHFILE" ]; then
else
echo "No $PATHFILE found, using current directory as parent"
echo "No $PATHFILE found, using current directory as parent" >> debug.log

PARENT_PATH="$PWD"
echo "Using current directory as parent: $PWD"
echo "Using current directory as parent: $PWD" >> debug.log
Expand Down

0 comments on commit e6009ed

Please sign in to comment.