From 5208173166022f0a74f4553cd9fc7b725c6f2d55 Mon Sep 17 00:00:00 2001 From: Noah Phillips Date: Tue, 7 Apr 2020 16:36:44 -0400 Subject: [PATCH 1/2] Adding YNAB budget tracker --- Finance/ynab-budget.sh | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Finance/ynab-budget.sh diff --git a/Finance/ynab-budget.sh b/Finance/ynab-budget.sh new file mode 100644 index 000000000..4c326acd9 --- /dev/null +++ b/Finance/ynab-budget.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# YNAB Bitbar +# 1.0.0 +# Noah Phillips +# noahsphillips +# Show your budgeted/unbudgeted balances from YNAB +# +# node +# https://github.com/noahsphillips/ynab-bitbar + +INSTALLER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +INSTALLER_PATH="$INSTALLER_DIR/$(basename $0)" + +# Go to the BitBar plugins directory +cd "$(defaults read com.matryer.BitBar pluginsDirectory)" + +# If already installed, check for version updates +if [ -d "ynab-bitbar" ]; then + cd ynab-bitbar + echo "Updating ynab-bitbar..." + git pull origin master --quiet + echo "Updated successfully." +# If not installed, clone the repository +else + echo "Downloading ynab-bitbar..." + git clone https://github.com/noahsphillips/ynab-bitbar --quiet + echo "Downloaded successfully." + cd ynab-bitbar +fi + +# Install node dependencies +echo "Installing npm dependencies..." +npm install &>/dev/null +echo "Dependencies installed." + +# Create the symlink if it doesn't exist +cd .. +if ! [ -L "./ynab-bitbar.15m.js" ]; then + echo "Linking..." + ln -s ynab-bitbar/ynab-bitbar.15m.js + echo "Linked." +fi + +# Refresh the plugin +echo "Refreshing plugin..." +open "bitbar://refreshPlugin?name=ynab-bitbar.15m.js" +echo "Plugin refreshed." + +# Delete this script! +echo "Deleting installer..." +rm -- "$INSTALLER_PATH" +echo "Installer deleted." \ No newline at end of file From 9cf64b9b501d4b970296c9ded16fda47fb5d4430 Mon Sep 17 00:00:00 2001 From: Luis Cruz Date: Tue, 18 Apr 2023 09:11:09 -0400 Subject: [PATCH 2/2] Update ynab-budget.sh --- Finance/ynab-budget.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Finance/ynab-budget.sh b/Finance/ynab-budget.sh index 4c326acd9..e02f316dc 100644 --- a/Finance/ynab-budget.sh +++ b/Finance/ynab-budget.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -# YNAB Bitbar -# 1.0.0 -# Noah Phillips -# noahsphillips -# Show your budgeted/unbudgeted balances from YNAB -# -# node -# https://github.com/noahsphillips/ynab-bitbar +# YNAB Bitbar +# 1.0.0 +# Noah Phillips +# noahsphillips +# Show your budgeted/unbudgeted balances from YNAB +# +# node +# https://github.com/noahsphillips/ynab-bitbar INSTALLER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" INSTALLER_PATH="$INSTALLER_DIR/$(basename $0)" @@ -50,4 +50,4 @@ echo "Plugin refreshed." # Delete this script! echo "Deleting installer..." rm -- "$INSTALLER_PATH" -echo "Installer deleted." \ No newline at end of file +echo "Installer deleted."