-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,5 +135,4 @@ dmypy.json | |
.pyre/ | ||
.activate.sh | ||
.DS_Store | ||
.MyAppTest | ||
|
||
.MyAppTest/ |
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,50 @@ | ||
|
||
#!/bin/bash | ||
set -e | ||
|
||
# Get the directory of the current script | ||
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
# Change to that directory | ||
cd "$script_dir" | ||
|
||
# Confirm the current directory | ||
echo "Changed directory to: $(pwd)" | ||
echo "activate.sh change working directory to $(pwd)" | ||
|
||
|
||
if [ "$IN_ACTIVATED_ENV" = "1" ]; then | ||
IN_ACTIVATED_ENV=1 | ||
else | ||
IN_ACTIVATED_ENV=0 | ||
fi | ||
|
||
# If the 'venv' directory doesn't exist, print a message and exit. | ||
if [ ! -d "venv" ]; then | ||
cwd=$(pwd) | ||
echo "The 'venv' directory in $cwd does not exist, creating..." | ||
echo "OSTYPE: $OSTYPE" | ||
case "$OSTYPE" in | ||
darwin*|linux-gnu*) | ||
python3 ./install.py | ||
;; | ||
*) | ||
python ./install.py | ||
;; | ||
esac | ||
|
||
. ./venv/bin/activate | ||
export IN_ACTIVATED_ENV=1 | ||
this_dir=$(pwd) | ||
export PATH="$this_dir:$PATH" | ||
echo "Environment created." | ||
pip install -e . | ||
exit 0 | ||
fi | ||
|
||
if [[ "$IN_ACTIVATED_ENV" != "1" ]]; then | ||
. ./venv/bin/activate | ||
export IN_ACTIVATED_ENV=1 | ||
this_dir=$(pwd) | ||
export PATH="$this_dir:$PATH" | ||
fi |
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,4 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
pytest tests |
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