aboutsummaryrefslogtreecommitdiffstats
path: root/modules/security/gopass/gopass-sync-init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules/security/gopass/gopass-sync-init.sh')
-rw-r--r--modules/security/gopass/gopass-sync-init.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/security/gopass/gopass-sync-init.sh b/modules/security/gopass/gopass-sync-init.sh
index 5d5e423..8250458 100644
--- a/modules/security/gopass/gopass-sync-init.sh
+++ b/modules/security/gopass/gopass-sync-init.sh
@@ -8,24 +8,27 @@
STORE_DIR="@@PASSWORD_STORE_DIR@@"
-info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
-warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; }
+info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
+warn() { printf '\033[1;33m==> warning:\033[0m %s\n' "$*" >&2; }
error() { printf '\033[1;31m==> error:\033[0m %s\n' "$*" >&2; }
-die() { error "$*"; exit 1; }
+die() {
+ error "$*"
+ exit 1
+}
mkdir -p "$STORE_DIR"
cd "$STORE_DIR" || die "Failed to enter $STORE_DIR"
# Check if the directory is already a git repository; initialize if not
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
- info "Initializing git repository in $STORE_DIR..."
- git init
+ info "Initializing git repository in $STORE_DIR..."
+ git init
fi
# Check if the remote 'origin' is set; add it if not
if ! git remote | grep -q "^origin$"; then
- info "Adding remote origin..."
- git remote add origin "@@REMOTE_REPO_URL@@"
+ info "Adding remote origin..."
+ git remote add origin "@@REMOTE_REPO_URL@@"
fi
info "Password store git setup complete."