Update shell.nix

Added Cosmonic to path
This commit is contained in:
ajasibley 2023-05-23 23:10:25 +00:00
parent b45efa3239
commit 3d6d096ab8

View file

@ -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'