Browse Source

new: [monujo] add option ``version`` to set the target code version

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Valentin Lab 2 years ago
parent
commit
81f6e73c4c
  1. 4
      monujo/hooks/init
  2. 9
      monujo/lib/common
  3. 3
      monujo/metadata.yml

4
monujo/hooks/init

@ -14,7 +14,9 @@
set -e
monujo:code_init
version=$(options-get version 2>/dev/null)
monujo:code_init "$version"
monujo:code_config_base

9
monujo/lib/common

@ -8,8 +8,9 @@ CONFIGFILE="$LOCATION/config.json"
monujo:code_init() {
local version="$1"
if [ -e "$LOCATION/.version" ] && \
[ "$(cat "$LOCATION/.version")" == "$VERSION" ]; then
[ "$(cat "$LOCATION/.version")" == "$version" ]; then
return 0
fi
[ -d "$LOCATION" ] && rm -rf "$LOCATION"
@ -24,7 +25,7 @@ monujo:code_init() {
tar xjf file.tar.bz2 &&
rm file.tar.bz2 &&
chown root:root "$LOCATION" -R &&
echo "$VERSION" > "$LOCATION/.version"
echo "$version" > "$LOCATION/.version"
}
export MONUJO_OPTIONS=(
@ -33,6 +34,7 @@ export MONUJO_OPTIONS=(
map-url:string
local-password-retention-time:numeric
theme:struct\*
version:ignore
)
export MONUJO_OPTIONS_CONCAT=" ${MONUJO_OPTIONS[*]} "
@ -58,6 +60,9 @@ monujo:json-make() {
key=$(e "$key" | shyaml get-value)
ytype=$(e "$val" | shyaml get-type)
case "$MONUJO_OPTIONS_CONCAT" in
*" ${key}:ignore "*)
continue
;;
*" ${key}:bool "*)
val=$(e "$val" | shyaml get-value)
case "${val,,}" in

3
monujo/metadata.yml

@ -2,6 +2,9 @@ description: "LokWallet"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
subordinate: true
default-options:
version: 1.0.0-rc.3
uses:
publish-dir:
#constraint: required | recommended | optional

Loading…
Cancel
Save