misc/nit_env.sh: add support for zsh and fix fallback creating a file
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 29 Jan 2016 15:50:41 +0000 (10:50 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 9 Feb 2016 19:41:45 +0000 (14:41 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

misc/nit_env.sh

index 4b5a122..78ad0a3 100644 (file)
@@ -128,8 +128,11 @@ __nit_env_main() {
                elif [ -f "$HOME/.bash_profile" ]; then
                        echo "$str" >> "$HOME/.bash_profile"
                        echo "succesfuly registerd nit .bash_profile"
+               elif [ -f "$HOME/.zshrc" ]; then
+                       echo "$str" >> "$HOME/.zshrc"
+                       echo "successfuly registered nit in .zshrc"
                else
-                       echo "$str" >> "$HOME/.profile"
+                       echo "$str" > "$HOME/.profile"
                        echo "couldn't find .bashrc, .bash_profile, .profile. Created .profile and registered nit in it"
                fi
        fi