Skip to content

Commit

Permalink
Make scripts/singularity_cmd to be possible to be used as a library
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Dec 15, 2023
1 parent 9eb81cf commit eb6f3fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/singularity_cmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# THE SOFTWARE.
#

set -eu

function info() {
: # echo -e "I: " "$@" >&2
}
Expand Down Expand Up @@ -72,6 +70,13 @@ function readlink_f() {
readlink -f "$1" 2> /dev/null || python -c 'import sys, os ; print(os.path.realpath(sys.argv[1]))' "$1"
}

if [ "$#" = 0 ]; then
echo "Using as a library. Run with 'exec' or 'run' command and options."
exit 0
fi

set -eu

info "PWD=$PWD"

thisfile=$(readlink_f "$0")
Expand Down

0 comments on commit eb6f3fd

Please sign in to comment.