NeovimPortable/update.sh

28 lines
669 B
Bash
Executable file

#!/usr/bin/env bash
#set -eu -o pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
APPS_DIR="$SCRIPT_DIR""/apps"
URLS="$(\
curl -s https://api.github.com/repos/neovim/neovim/releases/latest |
grep -o 'https://.*linux64\.tar\.gz')\n"
FILENAMES="$(printf "$URLS" | xargs basename)"
printf ">> Found the following files:\n"
printf "$URLS"
printf "\n"
cd "$APPS_DIR"
printf ">> Downloading files:\n"
printf "$URLS" | xargs curl -LJO --progress-bar
printf "\n"
printf ">> Extracting files... "
printf "$FILENAMES" | xargs tar -xf
printf "done\n\n"
printf ">> Removing files:\n"
printf "$FILENAMES" | xargs rm -v
cd - > /dev/null