From cb1435a7e0515fb79dbf36c35039ad054603fe02 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:47:17 +0300 Subject: [PATCH] Install the git-sync script directly from the upstream repository --- .config/setup/06-install-git-sync.sh | 3 +++ .local/bin/resync-git-sync | 10 ++++++++++ .local/bin/upgrade | 6 ++++++ .profile | 5 +++++ 4 files changed, 24 insertions(+) create mode 100755 .config/setup/06-install-git-sync.sh create mode 100755 .local/bin/resync-git-sync diff --git a/.config/setup/06-install-git-sync.sh b/.config/setup/06-install-git-sync.sh new file mode 100755 index 0000000..ac57a8f --- /dev/null +++ b/.config/setup/06-install-git-sync.sh @@ -0,0 +1,3 @@ +#! /usr/bin/sh + +resync-git-sync diff --git a/.local/bin/resync-git-sync b/.local/bin/resync-git-sync new file mode 100755 index 0000000..5486d52 --- /dev/null +++ b/.local/bin/resync-git-sync @@ -0,0 +1,10 @@ +#! /usr/bin/sh + +REPO_DIR="$(systemd-path user-state-private)"/git-sync +if [ -d "${REPO_DIR}" ] +then + git -C "${REPO_DIR}" pull +else + cd "$(systemd-path user-state-private)" || exit + git clone https://github.com/simonthum/git-sync +fi diff --git a/.local/bin/upgrade b/.local/bin/upgrade index 768aa95..bff92e3 100755 --- a/.local/bin/upgrade +++ b/.local/bin/upgrade @@ -20,7 +20,13 @@ pipx_update() { done } +git_sync_update() { + echo Updating git-sync... + resync-git-sync +} + apt_update pipx_update cargo_update ghup +git_sync_update diff --git a/.profile b/.profile index 487832f..a5cdbc0 100644 --- a/.profile +++ b/.profile @@ -30,6 +30,11 @@ if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi +# Install the git-sync script +if [ -d "$(systemd-path user-state-private)"/git-sync ] ; then + PATH="$(systemd-path user-state-private)/git-sync:$PATH" +fi + umask 0007 export EDITOR="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system" export VISUAL="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system"