From 8eb0d2bcab83b7c05ea2d53ba67b42057ab3a16c Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 31 Aug 2023 15:03:34 +0300 Subject: [PATCH] chore(scripts): experimental git-crypt --- scripts/install-git-crypt.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/install-git-crypt.sh diff --git a/scripts/install-git-crypt.sh b/scripts/install-git-crypt.sh new file mode 100755 index 0000000..230ca8b --- /dev/null +++ b/scripts/install-git-crypt.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Install git-crypt +# NOTE: Experimental, wip +# +# shellcheck source=shared.sh +source "$HOME/.dotfiles/scripts/shared.sh" + +msg "Installing git-crypt" + +! have git-crypt && { + + REPO_URL="https://github.com/AGWA/git-crypt.git" + CHECK_PATH="${XDG_BIN_HOME}/git-crypt" + BUILD_PATH="/tmp/git-crypt" + + rm -rf "$BUILD_PATH" + + if [ ! -d "$CHECK_PATH" ]; then + git clone --depth 1 "$REPO_URL" "$BUILD_PATH" || true + cd "$BUILD_PATH" || msg_err "$BUILD_PATH not found" + make && make install PREFIX="$HOME/.local" + else + msg_done "git-crypt ($CHECK_PATH) already installed" + fi +} +msg_done "Done installing git-crypt" +