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

protect against scripts being sourced #121

Merged
merged 2 commits into from
Oct 23, 2023
Merged
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
5 changes: 5 additions & 0 deletions tmpl/tools/run-mypy.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#
# src: https://jaredkhan.com/blog/mypy-pre-commit

if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
echo "Please simply call the script instead of sourcing it!"
return
fi

set -o errexit

VERBOSE=${VERBOSE:-false}
Expand Down
5 changes: 5 additions & 0 deletions tmpl/tools/setup_env.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# - 2022-09 (S. Ruedisuehli) Refactor; add some options
#

if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
echo "Please simply call the script instead of sourcing it!"
return
fi

# Default env names
DEFAULT_ENV_NAME="{{ project_slug }}"

Expand Down
5 changes: 5 additions & 0 deletions tmpl/tools/setup_miniconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# - 2022-09 (S. Ruedisuehli) Refactor
#

if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
echo "Please simply call the script instead of sourcing it!"
return
fi

# Default options
INSTALL_PREFIX=${PWD}
USER_INSTALL=false
Expand Down
Loading