Skip to content

Commit 16f9333

Browse files
authored
Merge pull request #24 from JuliaParallel/initial
Add additional error checks
2 parents 0eec04a + 988fce7 commit 16f9333

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

juhpc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ info() {
197197
echo -e "$(ENV["JUHPC"]) \$message" >&2
198198
}
199199
200+
error() {
201+
local message="\$1"
202+
info "\e[1;31mERROR:\e[0m \$message"
203+
exit 1
204+
}
205+
200206
JULIAUP_EXE="$(ENV["JULIAUP_BINDIR"])/juliaup"
201207
202208
if [ ! -f "\$JULIAUP_EXE" ]; then
@@ -214,14 +220,16 @@ else
214220
fi
215221
""")
216222
' > "$JULIAUP_WRAPPER"
223+
224+
if [ ! -s "$JULIAUP_WRAPPER" ]; then error "Juliaup wrapper is missing or empty."; fi
217225
chmod +x "$JULIAUP_WRAPPER"
218226

219227
info "... done."
220228

221229

222230
# Create an activation script that sets environment variables for juliaup, julia and HPC key packages
223231

224-
info_start "Creating activation script"
232+
info_start "Creating activate script"
225233

226234
export JULIAUP_DEPOT="$JULIAUP_INSTALLDIR/depot"
227235
export JULIA_DEPOT="$JULIAUP_INSTALLDIR/depot"
@@ -257,6 +265,8 @@ $(haskey(ENV,"JUHPC_ADIOS2_HOME") && ENV["JUHPC_ADIOS2_HOME"] != "" ? """
257265
""" : "")
258266
""")' > "$ACTIVATE_SCRIPT"
259267

268+
if [ ! -s "$ACTIVATE_SCRIPT" ]; then error "Activate script is missing or empty."; fi
269+
260270
info "... done."
261271

262272

0 commit comments

Comments
 (0)