Skip to content

Commit

Permalink
feat(script): add check for pass/passage installation before initiali…
Browse files Browse the repository at this point in the history
…zation
  • Loading branch information
entelecheia committed Apr 5, 2024
1 parent 9c76a53 commit d0f2a22
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions chezmoi/dot_local/bin/executable_pass-init.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"

# check if pass is installed, otherwise exit
if ! command -v pass &>/dev/null; then
log_error "pass command not found. Please install pass before running this script."
exit 0
fi

log_task "Initializing pass"

# Environment variables
Expand Down
10 changes: 8 additions & 2 deletions chezmoi/dot_local/bin/executable_passage-init.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# shellcheck source=/dev/null
source "${HOME}/.config/shrc/00-dotfiles-export"

# check if passage is installed, otherwise exit
if ! command -v passage &>/dev/null; then
log_error "passage command not found. Please install passage before running this script."
exit 0
fi

log_task "Initializing passage"

# Environment variables
Expand Down Expand Up @@ -47,8 +53,8 @@ if ! git -C "${PASSAGE_DIR}" remote get-url origin >/dev/null 2>&1; then
fi

if ! gh auth status &>/dev/null; then
log_info "GitHub is not authenticated, skipping fetching and checking out main branch"
exit 0
log_info "GitHub is not authenticated, skipping fetching and checking out main branch"
exit 0
fi

# fetch and checkout the main branch
Expand Down

0 comments on commit d0f2a22

Please sign in to comment.