Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(volta): Make volta_deactivate.sh more portable #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions volta/deactivate.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
#!/bin/bash

# if VOLTA_HOME_PREFERRED is set, don't unset VOLTA_HOME; the user activated the
# conda environment with VOLTA_HOME already set, and we don't want to mess with
# it
if [ -n "$VOLTA_HOME_PREFERRED" ]; then
unset VOLTA_HOME_PREFERRED
else
# otherwise, clean up after ourselves
# remove the directory from PATH
directory_to_remove=$VOLTA_HOME/bin
# from https://unix.stackexchange.com/a/108933
PATH=:$PATH:
PATH=${PATH//:$directory_to_remove:/:}
PATH=${PATH#:}
PATH=${PATH%:}
new_path=""
old_ifs=$IFS
IFS=":"
for dir in $PATH; do
if [ "$dir" != "$directory_to_remove" ]; then
new_path="$new_path:$dir"
fi
done
IFS=$old_ifs

# Remove the leading colon if necessary
PATH=${new_path#:}

unset VOLTA_HOME
fi
2 changes: 1 addition & 1 deletion volta/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package:
name: {{ name }}
version: {{ version }}.memfault2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm keeping open a thread here until I run the GHA and push the new builds to Conda

version: {{ version }}.memfault3

source:
# bash for getting the sigs:
Expand Down
Loading