Author: Adam <git@apiote.xyz>
fix not run latest item
get.sh | 2 +-
diff --git a/get.sh b/get.sh index d2e12a9fb5f773bdbcce1d0369a42a98492ab320..e961f138bdda6f0e8067fc5fe4174ed310b0170b 100644 --- a/get.sh +++ b/get.sh @@ -38,7 +38,7 @@ podman inspect "item_${toy}_${item}" | jq '.[0].State.ExitCode' > "toys/$toy/$item.exit" podman rm "item_${toy}_${item}" >/dev/null 2>&1 fi [ "$item" = 'latest' ] && item=$(find "toys/$toy/" -type d -mindepth 1 -maxdepth 1 | grep -E '[0-9]+' | sort -n | tail -n1 | sed "s|toys/$toy/||") - if [ ! -d "toys/$toy/$item" ] + if [ -z "$item" ] || [ ! -d "toys/$toy/$item" ] then printf 'n;' elif [ ! -f "toys/$toy/$item.exit" ]