From 8144732fde4c4f4ffc26645cb551a723c2a394c7f0122d551adea646139900a6 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Thu, 21 Apr 2022 04:14:45 +0000 Subject: [PATCH] =?UTF-8?q?-=20update=20post=20install=20MESSAGE=20-=20upd?= =?UTF-8?q?ate=20helix.sh=20script:=20=20=20=20=20*=20The=20HELIX=5FRUNTIM?= =?UTF-8?q?E=20env=20var=20is=20causing=20some=20issues=20=20=20=20=20*=20?= =?UTF-8?q?current=20workaround=20is=20to=20check=20if=20$USER=20is=20root?= =?UTF-8?q?.=20otherwise,=20create=20a=20runtime=20directory=20=E2=86=92?= =?UTF-8?q?=20$HOME/.config/helix/runtime=20then=20run=20helix=20without?= =?UTF-8?q?=20the=20HELIX=5FRUNTIME=20env=20var.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/editors/helix?expand=0&rev=2 --- helix.sh | 8 +++++++- helix.spec | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/helix.sh b/helix.sh index f6d3aac..0833bf6 100644 --- a/helix.sh +++ b/helix.sh @@ -1,3 +1,9 @@ #!/bin/sh -HELIX_RUNTIME=/usr/lib64/helix/runtime exec /usr/lib64/helix/hx "$@" +if [ "$USER" == "root" ] +then + HELIX_RUNTIME=/usr/lib64/helix/runtime exec /usr/lib64/helix/hx "$@" +else + mkdir -p "$HOME/.config/helix/runtime" + exec /usr/lib64/helix/hx "$@" +fi diff --git a/helix.spec b/helix.spec index 2e231d1..1b67834 100644 --- a/helix.spec +++ b/helix.spec @@ -59,11 +59,11 @@ install -Dm755 %{SOURCE3} %{buildroot}%{_bindir}/%{name} %post -p /bin/bash MESSAGE="The launcher binary is renamed as 'helix', alias hx='helix' if you were using 'hx'. - Helix also needs its runtime files so make sure to copy/symlink the runtime/ directory into the config directory (for example ~/.config/helix/runtime). - Runtime directory is found in '/usr/lib64/helix/runtime'. - Then run 'helix --grammar fetch' then 'helix --grammar build' to install the grammars. - To customize language-specific settings, you can copy '/usr/share/doc/packages/helix/languages.toml' - to '~/.helix/' or '~/.config/helix'. More information can be found in https://docs.helix-editor.com/languages.html" +Helix also needs its runtime files so make sure to copy/symlink the runtime/ directory into the config directory (for example ~/.config/helix/runtime). +If you see an error when launching helix, copy the runtime directory. Runtime directory is found in '/usr/lib64/helix/runtime'. +Then run 'helix --grammar fetch' then 'helix --grammar build' to install the grammars. +To customize language-specific settings, you can copy '/usr/share/doc/packages/helix/languages.toml' +to '~/.helix/' or '~/.config/helix'. More information can be found in https://docs.helix-editor.com/languages.html" echo -e "${MESSAGE}" %files