Browse Source

new: [monujo] always overwrite with specified app version

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/27/head
Valentin Lab 3 years ago
parent
commit
c34731345e
  1. 28
      monujo/lib/common

28
monujo/lib/common

@ -8,19 +8,23 @@ CONFIGFILE="$LOCATION/config.json"
monujo:code_init() {
mkdir -p "$LOCATION"
if dir_is_empty "$LOCATION"; then
cd "$LOCATION"
info "First install, downloading '$SOURCE_URL'."
wget -q "$SOURCE_URL" -O file.tar.bz2 || {
err "Couldn't download '$SOURCE_URL'."
rm file.tar.bz2
return 1
}
tar xjf file.tar.bz2 &&
rm file.tar.bz2 &&
chown root:root "$LOCATION" -R
if [ -e "$LOCATION/.version" ] && \
[ "$(cat "$LOCATION/.version")" == "$VERSION" ]; then
return 0
fi
[ -d "$LOCATION" ] && rm -rf "$LOCATION"
mkdir -p "$LOCATION"
cd "$LOCATION"
info "Downloading '$SOURCE_URL'."
wget -q "$SOURCE_URL" -O file.tar.bz2 || {
err "Couldn't download '$SOURCE_URL'."
rm file.tar.bz2
return 1
}
tar xjf file.tar.bz2 &&
rm file.tar.bz2 &&
chown root:root "$LOCATION" -R &&
echo "$VERSION" > "$LOCATION/.version"
}
export MONUJO_OPTIONS=(

Loading…
Cancel
Save