Skip to content

Commit

Permalink
fix: improve error handling logic (#35)
Browse files Browse the repository at this point in the history
* fix: improve error handling logic

* remove test du

---------

Co-authored-by: Felix Mölder <[email protected]>
  • Loading branch information
johanneskoester and FelixMoelder authored Aug 7, 2023
1 parent 041738e commit bdc87e0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ eval "$4"
# create container file
if [ "$5" = 'containerize' ] ; then
snakemake --directory $1 --snakefile $2 --show-failed-logs $3 --containerize > Dockerfile
# return disk space usage on failing
if [[ "$?" -ne 0 && "$6" = true ]] ; then
du -h -d3 $1 && exit 1
fi
elif [ "$5" = 'run' ] ; then
# run snakemake with given args
snakemake --directory $1 --snakefile $2 --show-failed-logs $3
# return disk space usage on failing
if [[ "$?" -ne 0 && "$6" = true ]] ; then
df -h
echo "du home\n"
du -h -d3 /github/home
echo "du working directory\n"
du -h -d3 $1 && exit 1
if [[ "$?" -ne 0 ]]; then
if [[ "$6" = true ]]; then
# return disk usage and space on failing
df -h
printf "disk usage working directory"
du -h -d3 $1
fi
exit 1
fi
else
echo "Task input not recognized." && exit 1
Expand Down

0 comments on commit bdc87e0

Please sign in to comment.