From 71d5221a010ba8a92ce4ef703c3fafffe5bba694 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Fri, 2 May 2025 18:03:23 +0800 Subject: [PATCH] =?UTF-8?q?chezmoi=20nvim=20debian=E6=89=8B=E5=8B=95?= =?UTF-8?q?=E5=AE=89=E8=A3=9D=E8=85=B3=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run_onchange_before_linux-install-packages.sh.tmpl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl index 9e673a7..dd0e3f2 100644 --- a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl +++ b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl @@ -26,9 +26,12 @@ fi curl -LO https://github.com/neovim/neovim/releases/download/v0.11.1/nvim-linux-x86_64.appimage chmod u+x nvim-linux-x86_64.appimage ./nvim-linux-x86_64.appimage --appimage-extract -./squashfs-root/usr/bin/nvim -cp -rf squashfs-root/usr/* /usr/ -rm -r nvim-linux-x86_64.appimage squashfs-root +if [ "$EUID" -ne 0 ]; then + sudo cp -rf squashfs-root/usr/* /usr/ +else + cp -rf squashfs-root/usr/* /usr/ +fi + rm -r nvim-linux-x86_64.appimage squashfs-root {{ end }} {{ end -}}