From b2fcd1a3df73f178133d9a87f88edce1605c635f Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 21 Aug 2025 22:50:16 +0200 Subject: [PATCH] Configure function for adding paths to PATH env variable --- zsh/.zprofile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/zsh/.zprofile b/zsh/.zprofile index add8ea6..436d64b 100644 --- a/zsh/.zprofile +++ b/zsh/.zprofile @@ -1,7 +1,14 @@ -case ":$PATH:" in - *":$HOME/.local/bin:"*) ;; - *) export PATH="$HOME/.local/bin:$PATH" ;; -esac +function appendpath() { + local location="${1}" + case ":$PATH:" in + *":$location:"*) ;; + *) export PATH="$PATH:$location" ;; + esac +} + +appendpath "$HOME/.local/bin" +appendpath "$HOME/.config/emacs/bin" +unset appendpath # XDG variables export XDG_CONFIG_HOME=${HOME}/.config