From 6df49809665476f7a06a0fc55053066443562d81 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Tue, 31 Jan 2023 06:20:38 +0000 Subject: [PATCH] Update file run_onchange_after_14-keybase.tmpl --- .../universal/run_onchange_after_14-keybase.tmpl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl index 59c7f0b3..c484e7a4 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl @@ -7,12 +7,15 @@ {{ includeTemplate "universal/logg" }} if command -v keybase > /dev/null; then - logg info 'Ensuring /etc/keybase is a directory' - sudo mkdir -p /etc/keybase - KEYBASE_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/keybase/config.json" - logg info "Copying $KEYBASE_CONFIG to /etc/keybase/config.json" - sudo cp -f "$KEYBASE_CONFIG" /etc/keybase/config.json + if [ -f "$KEYBASE_CONFIG" ]; then + logg info 'Ensuring /etc/keybase is a directory' + sudo mkdir -p /etc/keybase + logg info "Copying $KEYBASE_CONFIG to /etc/keybase/config.json" + sudo cp -f "$KEYBASE_CONFIG" /etc/keybase/config.json + else + logg warn "No Keybase config located at $KEYBASE_CONFIG" + fi else logg info 'The `keybase` executable is not available' fi