Skip to content

Commit 36250b5

Browse files
committed
introduce JUHPC_SETUP_INSTALLLOG
1 parent 9eb3371 commit 36250b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

juhpc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ info() {
3232
if [[ "$JUHPC_VERBOSE" -ge "$verbose_min" ]]; then
3333
echo -e "$JUHPC $message" >&2
3434
fi
35-
echo -e "$JUHPC $message" >> "$TMP_JULIAUP_LOG"
35+
echo -e "$JUHPC $message" >> "$JUHPC_SETUP_INSTALLLOG"
3636
}
3737

3838
cleanup() {
@@ -66,9 +66,9 @@ check_dir() {
6666
julia_pref() {
6767
local cmd="$1"
6868
if [[ "$JUHPC_VERBOSE" -gt 1 ]]; then
69-
julia --project="$JULIA_PREFDIR" -e "$cmd" 2>&1 | tee -a "$TMP_JULIAUP_LOG"
69+
julia --project="$JULIA_PREFDIR" -e "$cmd" 2>&1 | tee -a "$JUHPC_SETUP_INSTALLLOG"
7070
else
71-
julia --project="$JULIA_PREFDIR" -e "$cmd" >> "$TMP_JULIAUP_LOG" 2>&1
71+
julia --project="$JULIA_PREFDIR" -e "$cmd" >> "$JUHPC_SETUP_INSTALLLOG" 2>&1
7272
fi
7373
}
7474

@@ -80,7 +80,9 @@ export JULIAUP_INSTALLDIR="$2"
8080
export JUHPC_POST_INSTALL_JL="$3"
8181

8282

83-
# Check/set environment variable defining verbosity of output
83+
# Check/set environment variables for logging and defining verbosity of output
84+
85+
export JUHPC_SETUP_INSTALLLOG="$JUHPC_SETUP_INSTALLDIR/setup_install.log" # Need to be defined at the very beginning
8486

8587
if [[ -z "$JUHPC_VERBOSE" ]]; then
8688
export JUHPC_VERBOSE=0
@@ -119,15 +121,14 @@ mkdir -p "$JUHPC_SETUP_INSTALLDIR" || { error "failed to create directory: $JUHP
119121
info "Installing juliaup and julia temporarily in $TMP_JULIAUP_ROOTDIR..."
120122

121123
export TMP_JULIAUP_BINDIR="$TMP_JULIAUP_ROOTDIR/bin" # juliaup and julia binaries
122-
export TMP_JULIAUP_LOG="$JUHPC_SETUP_INSTALLDIR/setup_install.log"
123124
export JULIAUP_DEPOT_PATH="$TMP_JULIAUP_ROOTDIR/depot"
124125
export JULIA_DEPOT_PATH="$TMP_JULIAUP_ROOTDIR/depot"
125126
export JULIA_PROJECT="$JULIA_DEPOT_PATH/environments/latest"
126127
export PATH=$(echo $PATH | perl -pe "s|[^:]*julia(?:up)?[^:]*:?||g") # Remove all juliaup paths from PATH
127128
export PATH=$TMP_JULIAUP_BINDIR:$PATH
128129

129130
check_dir "$TMP_JULIAUP_ROOTDIR"
130-
curl -fsSL https://install.julialang.org | sh -s -- --add-to-path=no --yes --path="$TMP_JULIAUP_ROOTDIR" --background-selfupdate 0 --startup-selfupdate 0 > $TMP_JULIAUP_LOG || { error "failed to install Juliaup (and Julia) in $TMP_JULIAUP_ROOTDIR."; }
131+
curl -fsSL https://install.julialang.org | sh -s -- --add-to-path=no --yes --path="$TMP_JULIAUP_ROOTDIR" --background-selfupdate 0 --startup-selfupdate 0 > $JUHPC_SETUP_INSTALLLOG || { error "failed to install Juliaup (and Julia) in $TMP_JULIAUP_ROOTDIR."; }
131132

132133
if [ ! -f "$TMP_JULIAUP_BINDIR/juliaup" ]; then error "temporary juliaup installation failed."; fi
133134

0 commit comments

Comments
 (0)