-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates cookie-cutter to incorporate new metadata fields in the templ…
…ate (#113) * adds `version_display` in cookie-cutter's query (defaults to version) * if `version_display`==`version`, it gets removed from the final `metadata.yml` since it is optional * adds activation of `.ospac` environment (analogous to python virtual environments) * renames executables
- Loading branch information
Showing
8 changed files
with
126 additions
and
30 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
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,67 @@ | ||
#!/bin/bash | ||
|
||
# Store the current PATH | ||
export _OLD_OSPARC_PATH=$PATH | ||
|
||
|
||
# Get the directory of the currently running script | ||
BIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
OSPARC_ENV=$(dirname "${BIN_DIR}") | ||
|
||
|
||
# Add .osparc/bin to the PATH | ||
export PATH="$BIN_DIR/.osparc/bin:$PATH" | ||
|
||
|
||
deactivate () { | ||
# Unset the OLD_PATH variable | ||
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all | ||
if ! [ -z "${_OLD_OSPARC_PATH:+_}" ] ; then | ||
PATH="$_OLD_OSPARC_PATH" | ||
export PATH | ||
unset _OLD_OSPARC_PATH | ||
fi | ||
|
||
# The hash command must be called to get it to forget past | ||
# commands. Without forgetting past commands the $PATH changes | ||
# we made may not be respected | ||
hash -r 2>/dev/null | ||
|
||
|
||
# Removes (osparc) in prompt | ||
if ! [ -z "${_OLD_OSPARC_PS1+_}" ] ; then | ||
PS1="$_OLD_OSPARC_PS1" | ||
export PS1 | ||
unset _OLD_OSPARC_PS1 | ||
fi | ||
|
||
unset OSPARC_ENV | ||
unset OSPARC_ENV_PROMPT | ||
if [ ! "${1-}" = "nondestructive" ] ; then | ||
# Self destruct! | ||
unset -f deactivate | ||
echo "osparc environment deactivated" | ||
fi | ||
} | ||
|
||
# unset irrelevant variables | ||
deactivate nondestructive | ||
|
||
|
||
# Adds (osparc) in prompt | ||
if [ "xosparc" != x ] ; then | ||
OSPARC_ENV_PROMPT=".osparc" | ||
else | ||
OSPARC_ENV_PROMPT=$(basename "$OSPARC_ENV") | ||
fi | ||
export OSPARC_ENV_PROMPT | ||
|
||
|
||
if [ -z "${OSPARC_ENV_DISABLE_PROMPT-}" ] ; then | ||
_OLD_OSPARC_PS1="${PS1-}" | ||
PS1="(${OSPARC_ENV_PROMPT}) ${PS1-}" | ||
export PS1 | ||
fi | ||
|
||
# Inform the user | ||
echo "Environment activated. To deactivate, type 'deactivate'" |
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
4 changes: 4 additions & 0 deletions
4
...cutter.project_slug}}/.osparc/bin/yq.bash → {{cookiecutter.project_slug}}/.osparc/bin/yq
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