Skip to content

Instantly share code, notes, and snippets.

@mkakh
Last active July 25, 2023 06:13
Show Gist options
  • Save mkakh/93973d3ffc13059c8d996e2140ebb9d3 to your computer and use it in GitHub Desktop.
Save mkakh/93973d3ffc13059c8d996e2140ebb9d3 to your computer and use it in GitHub Desktop.
zsh version of source-env.sh for IsoNet-cryoET/IsoNet
#!/bin/zsh
# The original source code is published in IsoNet-cryoET/IsoNet under the MIT license.
###############
# THIS FILE CAN BE SOURCED INTO YOUR SHELL
# TO SET UP ENVIRONMENT WHERE IsoNet CAN BE EXECUTED
###############
_ISONET_REPO_ROOT="$(dirname "$(realpath "${(%):-%x}")")"
isonet_PYTHONPATH="$(dirname "${_ISONET_REPO_ROOT}")"
if ! echo "${PYTHONPATH}" | grep -- "${isonet_PYTHONPATH}" >/dev/null; then
export PYTHONPATH="${isonet_PYTHONPATH}:${PYTHONPATH}"
echo "| ENV: PYTHONPATH='${PYTHONPATH}'"
fi
isonet_PATH="${_ISONET_REPO_ROOT}/bin"
if ! echo "${PATH}" | grep -- "${isonet_PATH}" >/dev/null; then
export PATH="${isonet_PATH}:${PATH}"
echo "| ENV: PATH='${PATH}'"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment