-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from johli/revision-upd-4
Revision update
- Loading branch information
Showing
8 changed files
with
323 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# set these variables before running the script | ||
LOCAL_BASKERVILLE_PATH="/home/jlinder/baskerville" | ||
LOCAL_CONDA_PATH="/home/jlinder/anaconda3/etc/profile.d/conda.sh" | ||
|
||
# create env_vars sh scripts in local conda env | ||
mkdir -p "$CONDA_PREFIX/etc/conda/activate.d" | ||
mkdir -p "$CONDA_PREFIX/etc/conda/deactivate.d" | ||
|
||
file_vars_act="$CONDA_PREFIX/etc/conda/activate.d/env_vars.sh" | ||
if ! [ -e $file_vars_act ]; then | ||
echo '#!/bin/sh' > $file_vars_act | ||
fi | ||
|
||
file_vars_deact="$CONDA_PREFIX/etc/conda/deactivate.d/env_vars.sh" | ||
if ! [ -e $file_vars_deact ]; then | ||
echo '#!/bin/sh' > $file_vars_deact | ||
fi | ||
|
||
# append env variable exports to /activate.d/env_vars.sh | ||
echo "export BASKERVILLE_DIR=$LOCAL_BASKERVILLE_PATH" >> $file_vars_act | ||
echo 'export PATH=$BASKERVILLE_DIR/src/baskerville/scripts:$PATH' >> $file_vars_act | ||
echo 'export PYTHONPATH=$BASKERVILLE_DIR/src/baskerville/scripts:$PYTHONPATH' >> $file_vars_act | ||
|
||
echo "export BASKERVILLE_CONDA=$LOCAL_CONDA_PATH" >> $file_vars_act | ||
|
||
# append env variable unsets to /deactivate.d/env_vars.sh | ||
echo 'unset BASKERVILLE_DIR' >> $file_vars_deact | ||
echo 'unset BASKERVILLE_CONDA' >> $file_vars_deact | ||
|
||
# finally activate env variables | ||
source $file_vars_act |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.