summaryrefslogtreecommitdiffstatshomepage
path: root/run_before_canonical-nvim-lock.sh.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'run_before_canonical-nvim-lock.sh.tmpl')
-rw-r--r--run_before_canonical-nvim-lock.sh.tmpl9
1 files changed, 9 insertions, 0 deletions
diff --git a/run_before_canonical-nvim-lock.sh.tmpl b/run_before_canonical-nvim-lock.sh.tmpl
new file mode 100644
index 0000000..3aa3606
--- /dev/null
+++ b/run_before_canonical-nvim-lock.sh.tmpl
@@ -0,0 +1,9 @@
+{{ if eq (default "host" (index . "machineRole")) "canonical" -}}
+#!/bin/sh
+set -eu
+target="${XDG_CONFIG_HOME:-$HOME/.config}/nvim/nvim-pack-lock.json"
+if [ ! -e "$target" ] && [ ! -L "$target" ]; then
+ mkdir -p "$(dirname "$target")"
+ cp {{ printf "%s/dot_config/nvim/nvim-pack-lock.json" .chezmoi.sourceDir | quote }} "$target"
+fi
+{{ end -}}