bruno auto updates
This commit is contained in:
parent
ea9acaaded
commit
7771a697ac
1 changed files with 21 additions and 23 deletions
|
@ -2,35 +2,33 @@
|
||||||
|
|
||||||
BRUNO_PATH="$HOME/.local/share/bruno"
|
BRUNO_PATH="$HOME/.local/share/bruno"
|
||||||
|
|
||||||
if ! [ -d "$BRUNO_PATH" ] ; then
|
INSTALLED=
|
||||||
mkdir -p "$BRUNO_PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LATEST="$(curl -s https://api.github.com/repos/usebruno/bruno/releases/latest |
|
|
||||||
grep '"name":.*\.AppImage' | cut -d'"' -f 4)"
|
|
||||||
|
|
||||||
for v in "$BRUNO_PATH"/*.AppImage ; do
|
for v in "$BRUNO_PATH"/*.AppImage ; do
|
||||||
INSTALLED="${v##*/}"
|
if [ -f "$v" ] && [ -x "$v" ] ; then
|
||||||
|
INSTALLED="${v##*/}"
|
||||||
|
fi
|
||||||
unset v
|
unset v
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$INSTALLED" != "$LATEST" ] ; then
|
if [ -z "$INSTALLED" ] ; then
|
||||||
opt="$(printf 'Yes\nNo\n' | menu "Newer bruno version available, update?")"
|
echo "Installing bruno..."
|
||||||
|
|
||||||
if [ "$opt" = "Yes" ] ; then
|
if ! [ -d "$BRUNO_PATH" ] ; then
|
||||||
echo "Updating bruno..."
|
mkdir -p "$BRUNO_PATH"
|
||||||
|
|
||||||
if ! curl -L --progress-bar -o "$BRUNO_PATH/$LATEST" \
|
|
||||||
https://github.com/usebruno/bruno/releases/latest/download/"$LATEST" ; then
|
|
||||||
echo "Error updating bruno"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod +x "$BRUNO_PATH/$LATEST"
|
|
||||||
|
|
||||||
INSTALLED="$LATEST"
|
|
||||||
fi
|
fi
|
||||||
unset opt
|
|
||||||
|
LATEST="$(curl -s https://api.github.com/repos/usebruno/bruno/releases/latest |
|
||||||
|
grep '"name":.*\.AppImage' | cut -d'"' -f 4)"
|
||||||
|
|
||||||
|
if ! curl -L --progress-bar -o "$BRUNO_PATH/$LATEST" \
|
||||||
|
https://github.com/usebruno/bruno/releases/latest/download/"$LATEST" ; then
|
||||||
|
echo "Error installing bruno"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
chmod +x "$BRUNO_PATH/$LATEST"
|
||||||
|
|
||||||
|
INSTALLED="$LATEST"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec "$BRUNO_PATH/$INSTALLED"
|
exec "$BRUNO_PATH/$INSTALLED"
|
||||||
|
|
Loading…
Reference in a new issue