From 4eb69b044ffab5197dfbf0f5d40e7cdb3d75e222 Mon Sep 17 00:00:00 2001 From: Philipp Dargel Date: Thu, 31 Mar 2022 19:58:59 +0200 Subject: [PATCH] #30: warn if bash is not installed --- nix-shell.plugin.zsh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nix-shell.plugin.zsh b/nix-shell.plugin.zsh index 1c400be..f8a6c4e 100644 --- a/nix-shell.plugin.zsh +++ b/nix-shell.plugin.zsh @@ -1,6 +1,15 @@ NIX_SHELL_PLUGIN_DIR=${0:a:h} +which bash > /dev/null 2>&1 +if [ "$?" -ne "0" ]; then + echo + echo " WARNING: bash is not installed." + echo " for zsh-nix-shell to work bash has to be in PATH" + echo +fi + + # extracts packages argument from args and passes them in $NIX_SHELL_PACKAGES variable. function nix-shell() { local -a ARGS; ARGS=("$@")