Skip to content

Commit

Permalink
Merge pull request #157 from lsst/tickets/DM-34029
Browse files Browse the repository at this point in the history
DM-34029: Improve env load instructions.
  • Loading branch information
ktlim committed Mar 11, 2022
2 parents 0233ae4 + 96b0544 commit 38c8514
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/lsstinstall
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,10 @@ else
fi

# Create load scripts

source_cmd=source
if [ -f loadLSST.sh ]; then
echo "loadLSST.sh exists; not overwriting"
source_cmd="LSST_CONDA_ENV_NAME=${rubinenv_name} source"
elif [ -n "$dryrun" ]; then
$dryrun cat \> loadLSST.sh
else
Expand Down Expand Up @@ -355,9 +356,9 @@ cat <<EOF
Bootstrap complete. To continue installing (and to use) the LSST stack type
one of:
source "${cwd}/loadLSST.sh" # for bash, ash, fish, zsh
${source_cmd} "${cwd}/loadLSST.sh" # for bash, ash, fish, zsh
or
source "${cwd}/envconfig" # for lsstsw clones
${source_cmd} "${cwd}/envconfig" # for lsstsw clones
Individual LSST packages may now be installed with the usual \`eups distrib
install\` command. For example, to install the latest weekly release of the
Expand Down
10 changes: 10 additions & 0 deletions test-lsstinstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ CONDA_EXE="somewhere/bin/conda" ./scripts/lsstinstall -n -P -p "$testdir" | grep
rm -rf "$testdir"
)

# Check new environment handling
(
origdir=$(pwd)
mkdir -p "$testdir"
cd "$testdir"
touch ./loadLSST.sh
"${origdir}/scripts/lsstinstall" -n -v 3.0.0 | grepf "LSST_CONDA_ENV_NAME=lsst-scipipe-3.0.0 source "
rm -rf "$testdir"
)

# Test for argument parsing failures
xfail ./scripts/lsstinstall -n -v cb4e2dc -T w_2021_11
xfail ./scripts/lsstinstall -n -v cb4e2dc -X w_2021_11
Expand Down

0 comments on commit 38c8514

Please sign in to comment.