#!/usr/bin/env bash # Fetching last Obsidian version wget -q https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest echo "Retrieve the last package..." grep 'browser_download_url": ".*.snap"' latest | awk '{ print substr ($0, 32 ) }' | awk '{ print substr( $0, 1, length($0)-1 ) }' > url rm latest # Downloading package wget -q --show-progress -i url -O obsidian.snap rm url # Installing sudo snap install --dangerous obsidian.snap # Removing package rm obsidian.snap echo -e "\nObsidian installed or updated! 🎉"