From 1b4da5d1846f15a6ca96d0f91f3c7ca818a9f30d Mon Sep 17 00:00:00 2001 From: hesam-init Date: Fri, 22 Mar 2024 00:55:08 +0330 Subject: [PATCH] fix: env loader --- configs/shell/.zsh/functions/utils.zsh | 0 configs/shell/.zshenv | 28 +++++++++++++++++--------- configs/shell/.zshrc | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 configs/shell/.zsh/functions/utils.zsh diff --git a/configs/shell/.zsh/functions/utils.zsh b/configs/shell/.zsh/functions/utils.zsh new file mode 100644 index 0000000..e69de29 diff --git a/configs/shell/.zshenv b/configs/shell/.zshenv index a8529bd..f28bfc4 100644 --- a/configs/shell/.zshenv +++ b/configs/shell/.zshenv @@ -10,19 +10,27 @@ export VOID_PACKAGES_PATH=$HOME/.local/pkgs/void-packages export DNS_CHANGER=$HOME/.shell/dns-changer.sh export STEAM_OS=$HOME/.steam-os/main.sh -if [ -d "$HOME/platform-tools" ]; then +if [ -d "/home/$USER/platform-tools" ]; then export PATH="$HOME/platform-tools:$PATH" fi -export DENO_INSTALL="/home/$USER/.deno" -export PATH="$HOME/.local/share/bob/nvim-bin:$PATH" -export PATH="$DENO_INSTALL/bin:$PATH" +if [ -d "/home/$USER/.deno" ]; then + export DENO_INSTALL="/home/$USER/.deno" + export PATH="$DENO_INSTALL/bin:$PATH" +fi -. "$HOME/.cargo/env" +if [ -d "/home/$USER/.cargo" ]; then + . "/home/$USER/.cargo/env" +fi -export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +if [ -d "/home/$USER/.bun" ]; then + [ -s "/home/$USER/.bun/_bun" ] && source "/home/$USER/.bun/_bun" + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" +fi -[ -s "/home/$USER/.bun/_bun" ] && source "/home/$USER/.bun/_bun" -export BUN_INSTALL="$HOME/.bun" -export PATH="$BUN_INSTALL/bin:$PATH" +if [ -d "/home/$USER/.nvm" ]; then + export PATH="$HOME/.local/share/bob/nvim-bin:$PATH" + export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +fi diff --git a/configs/shell/.zshrc b/configs/shell/.zshrc index da94327..3b98011 100644 --- a/configs/shell/.zshrc +++ b/configs/shell/.zshrc @@ -17,7 +17,7 @@ else fi source $ZSH/oh-my-zsh.sh -source ~/.zsh/aliases/main.zsh source ~/.zsh/functions/main.zsh +source ~/.zsh/aliases/main.zsh eval "$(atuin init zsh)"