Browse Source

new: [monujo] always overwrite with specified app version

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

12
monujo/lib/common

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

Loading…
Cancel
Save