Skip to content

Commit

Permalink
Don't fail if $SCRATCH isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Sep 10, 2024
1 parent 9c0b4a1 commit d335460
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions job_scripts/slurm/chainslurm-menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ if [[ "$oldjob" -gt 0 ]]; then
old_dir=$(readlink -f "$old_dir")
new_dir=$(readlink -f "$PWD")
if [[ "$old_dir" != "$new_dir" ]]; then
old_pretty="${old_dir/$SCRATCH/\$SCRATCH}"
old_pretty=$old_dir
new_pretty=$new_dir
if [[ -n ${SCRATCH+x} ]]; then
old_pretty="${old_pretty/$SCRATCH/\$SCRATCH}"
new_pretty="${new_pretty/$SCRATCH/\$SCRATCH}"
fi
old_pretty="${old_pretty/$HOME/\~}"
new_pretty="${new_dir/$SCRATCH/\$SCRATCH}"
new_pretty="${new_pretty/$HOME/\~}"
echo "Error: selected job was submitted from ${old_pretty}, but you are currently in ${new_pretty}"
exit 2
Expand Down

0 comments on commit d335460

Please sign in to comment.