depot/third_party/nixpkgs/pkgs/by-name/wi/wikiman/fix-paths.patch

44 lines
1.5 KiB
Diff

diff --git a/wikiman.sh b/wikiman.sh
index 89a436e..adc6510 100755
--- a/wikiman.sh
+++ b/wikiman.sh
@@ -46,38 +46,7 @@ if printenv WIKIMAN_TUI_PREVIEW >/dev/null; then
fi
init() {
-
- # BSD compatibility: Installation prefix
-
- case "$(dirname "$0")" in
- "$HOME/bin"|"$HOME/.local/bin")
- conf_sys_usr="$HOME/.local/share";
- conf_sys_etc="${XDG_CONFIG_HOME:-"$HOME/.config"}/wikiman";;
- '/bin'|'/sbin'|'/usr/bin'|'/usr/sbin')
- conf_sys_usr='/usr';
- conf_sys_etc='/etc';;
- '/usr/local/bin'|'/usr/local/sbin')
- conf_sys_usr='/usr/local';
- conf_sys_etc='/usr/local/etc';;
- *)
- case "$(dirname "$(command -v wikiman)")" in
- "$HOME/bin"|"$HOME/.local/bin")
- echo 'warning: unsupported installation path, using fallback for user install' 1>&2;
- conf_sys_usr="$HOME/.local/share";
- conf_sys_etc="${XDG_CONFIG_HOME:-"$HOME/.config"}/wikiman";;
- '/bin'|'/sbin'|'/usr/bin'|'/usr/sbin')
- echo 'warning: unsupported installation path, using fallback for Linux' 1>&2;
- conf_sys_usr='/usr';
- conf_sys_etc='/etc';;
- '/usr/local/bin'|'/usr/local/sbin')
- echo 'warning: unsupported installation path, using fallback for BSD' 1>&2;
- conf_sys_usr='/usr/local';
- conf_sys_etc='/usr/local/etc';;
- *)
- echo 'error: unsupported installation path - failed to establish fallback' 1>&2;
- exit 5;;
- esac;;
- esac
+ conf_sys_etc="/etc/xdg/wikiman/wikiman.conf"
export conf_sys_usr
export conf_sys_etc