mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-04 15:02:48 +02:00
fix: return a empty json if there are no repo to stat
This commit is contained in:
parent
3e63f187e8
commit
ea68dea83f
|
@ -26,6 +26,10 @@ fi
|
||||||
# Default value if .env not exists
|
# Default value if .env not exists
|
||||||
: "${home:=/home/borgwarehouse}"
|
: "${home:=/home/borgwarehouse}"
|
||||||
|
|
||||||
stat --format='{"repositoryName":"%n","lastSave":%Y}' \
|
if [ -n "$(find ${home}/repos -mindepth 1 -maxdepth 1 -type d)" ]; then
|
||||||
|
stat --format='{"repositoryName":"%n","lastSave":%Y}' \
|
||||||
${home}/repos/*/integrity* |
|
${home}/repos/*/integrity* |
|
||||||
jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]'
|
jq --slurp '[.[] | .repositoryName = (.repositoryName | split("/")[-2])]'
|
||||||
|
else
|
||||||
|
echo "[]"
|
||||||
|
fi
|
Loading…
Reference in a new issue