-
Notifications
You must be signed in to change notification settings - Fork 31
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 #121 from nilsjor/improved-scripting
Improved scripting
- Loading branch information
Showing
5 changed files
with
37 additions
and
38 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 |
---|---|---|
@@ -1,28 +1,11 @@ | ||
#!/bin/bash -i | ||
#!/bin/bash | ||
|
||
# Check if the first argument is "activate", and set the PATH environment variable accordingly | ||
if [ "$1" = "activate" ]; then | ||
|
||
# Environment variables | ||
export PLANUTILS_PREFIX="~/.planutils" | ||
export PATH="$PATH:$PLANUTILS_PREFIX/bin" | ||
|
||
# Add a blue coloured shell prompt prefix (planutils) | ||
export PS1="(\[\e[1;34m\]planutils\[\e[0m\]) $PS1" | ||
|
||
echo | ||
echo " Entering planutils environment..." | ||
echo | ||
|
||
# Enter the shell | ||
$SHELL --init-file <(echo "export PS1=\"$PS1\"") | ||
|
||
# Clear history | ||
history -cw | ||
planutils_activate | ||
|
||
# Else, call planutils via python | ||
else | ||
python3 -c "import planutils; planutils.main()" "$@" | ||
exit $? | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash -i | ||
|
||
# Environment variables | ||
export PLANUTILS_PREFIX="~/.planutils" | ||
export PATH="$PATH:$PLANUTILS_PREFIX/bin" | ||
|
||
# Add a blue coloured shell prompt prefix (planutils) | ||
export PS1="(\[\e[1;34m\]planutils\[\e[0m\]) $PS1" | ||
|
||
echo | ||
echo " Entering planutils environment..." | ||
echo | ||
|
||
# Enter the shell | ||
$SHELL --init-file <(echo "export PS1=\"$PS1\"") |
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