wip3
This commit is contained in:
46
install/anytype
Executable file
46
install/anytype
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
##makedesc: Manage anytype (deb)
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
installDir="$HOME/install/anytype"
|
||||
|
||||
install() {
|
||||
release="$(curl -s 'https://api.github.com/repos/anyproto/anytype-ts/releases/latest')"
|
||||
tag="$(echo "$release" | jq -r '.tag_name')"
|
||||
asset="$(echo "$release" | jq -r '.assets.[] | select(.name | test("amd64.deb$"))')"
|
||||
url="$(echo "$asset" | jq -r '.browser_download_url')"
|
||||
echo -e "$tag $url"
|
||||
|
||||
echo
|
||||
echo "==============================================="
|
||||
echo "Installing anytype $tag"
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
mkdir -p "$installDir"
|
||||
filepath="$installDir/anytype_${tag}_amd46.deb"
|
||||
wget "$url" -O "$filepath"
|
||||
sudo dpkg -i "$filepath"
|
||||
|
||||
echo
|
||||
echo "Finish! $tag"
|
||||
echo
|
||||
}
|
||||
|
||||
remove() {
|
||||
echo
|
||||
echo "==============================================="
|
||||
echo "Removing anytype"
|
||||
echo "==============================================="
|
||||
echo
|
||||
sudo apt purge -y anytype*
|
||||
echo
|
||||
echo "Finish!"
|
||||
echo
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
r|remove|d|delete|p|purge) remove ;;
|
||||
*) install ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user