From 02ebb592df2588fd64dfce012b2677cdc68e07f9 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Thu, 15 Aug 2019 00:03:45 +0200 Subject: [PATCH] [shell/cnf] check which shell before sourcing --- shell/command-not-found.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/shell/command-not-found.sh b/shell/command-not-found.sh index ffa7f25..b4953e8 100755 --- a/shell/command-not-found.sh +++ b/shell/command-not-found.sh @@ -1,4 +1,11 @@ #!/bin/sh # arch -[ -r /usr/share/doc/pkgfile/command-not-found.bash ] && . /usr/share/doc/pkgfile/command-not-found.bash +if [ "${BASH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.bash ]; then + . /usr/share/doc/pkgfile/command-not-found.bash +fi + +if [ "${ZSH_VERSION}" ] && [ -r /usr/share/doc/pkgfile/command-not-found.zsh ]; then + . /usr/share/doc/pkgfile/command-not-found.zsh +fi +