Update shell.nix
Added Cosmonic to path
This commit is contained in:
parent
b45efa3239
commit
3d6d096ab8
1 changed files with 15 additions and 1 deletions
16
shell.nix
16
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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue