mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Fetch default value from manifest
This commit is contained in:
parent
f00feb7b18
commit
a0c2b22be9
1 changed files with 10 additions and 1 deletions
11
lib/tests.sh
11
lib/tests.sh
|
@ -58,9 +58,18 @@ _INSTALL_APP () {
|
||||||
LXC_START "bash /preinstall.sh"
|
LXC_START "bash /preinstall.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Note : we do this at this stage and not during the parsing of check_process
|
||||||
|
# because this also applies to upgrades ...
|
||||||
|
# For all manifest arg
|
||||||
for ARG in $(jq -r '.arguments.install[].name' $package_path/manifest.json)
|
for ARG in $(jq -r '.arguments.install[].name' $package_path/manifest.json)
|
||||||
do
|
do
|
||||||
echo "$install_args" | grep -q -E "\<$ARG=" || { log_error "Missing install arg $ARG ?"; return 1; }
|
# If the argument is not yet in install args, add its default value
|
||||||
|
if ! echo "$install_args" | grep -q -E "\<$ARG="
|
||||||
|
then
|
||||||
|
local default_value=$(jq -e -r --arg ARG $ARG '.arguments.install[] | select(.name==$ARG) | .default' $package_path/manifest.json)
|
||||||
|
[[ $? -eq 0 ]] || { log_error "Missing install arg $ARG ?"; return 1; }
|
||||||
|
install_args+="&$ARG=$default_value"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install the application in a LXC container
|
# Install the application in a LXC container
|
||||||
|
|
Loading…
Add table
Reference in a new issue