From c9d23e3c738ff40c11fe4ce87c0dab3181a073c5 Mon Sep 17 00:00:00 2001 From: Xevion Date: Thu, 7 Nov 2024 17:20:12 -0600 Subject: [PATCH] Fix before-source-state exiting early, silence apt update, silence binstall --help, add inotify install --- home/.before-source-state.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/home/.before-source-state.sh b/home/.before-source-state.sh index 6672cda..b112361 100755 --- a/home/.before-source-state.sh +++ b/home/.before-source-state.sh @@ -1,6 +1,5 @@ #!/bin/sh - -type rbw >/dev/null 2>&1 && exit +set -eu apt_update() { # Only run apt update once @@ -8,12 +7,12 @@ apt_update() { return fi - sudo apt update + sudo apt update >/dev/null if [ $? -ne 0 ]; then echo "Failed to update apt" exit 1 - else + else touch /tmp/.apt-updated fi } @@ -29,7 +28,7 @@ install_age() { install_cargo_binstall() { # Test if cargo binstall is installed - cargo binstall --help + cargo binstall --help >/dev/null 2>&1 if [ $? -eq 0 ]; then return fi @@ -54,8 +53,17 @@ install_rbw() { exit 1 } +install_inotify() { + if ! dpkg -l inotify-tools >/dev/null 2>&1; then + echo "Installing inotify-tools" + apt_update + sudo apt install inotify-tools + fi +} + +install_inotify install_age install_cargo_binstall install_rbw rbw login -rbw sync \ No newline at end of file +rbw sync