From 3d6d096ab8acb5e3011e8579501cad2e46542b3f Mon Sep 17 00:00:00 2001 From: ajasibley <125228925+ajasibley@users.noreply.github.com> Date: Tue, 23 May 2023 23:10:25 +0000 Subject: [PATCH] Update shell.nix Added Cosmonic to path --- shell.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index e87b94265..58437052c 100644 --- a/shell.nix +++ b/shell.nix @@ -64,7 +64,21 @@ pkgs.mkShell { # Check if cosmo is installed, if not install it if ! command -v cosmo &> /dev/null; then - bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)" + bash -c "$(curl -fsSL https://cosmonic.sh/install.sh)" + + # Get the current shell name + current_shell="$(basename "$SHELL")" + + # Update the corresponding configuration file based on the current shell + if [[ "$current_shell" == "bash" ]]; then + echo "export PATH=\"/Users/test/.cosmo/bin:\${PATH}\"" >> "${HOME}/.bashrc" && source "${HOME}/.bashrc" + elif [[ "$current_shell" == "zsh" ]]; then + echo "export PATH=\"/Users/test/.cosmo/bin:\${PATH}\"" >> "${HOME}/.zshrc" && source "${HOME}/.zshrc" + else + echo "Unsupported shell: $current_shell" + exit 1 + fi + fi cat <<'EOF'