From 1c9a21d72c72329052437f4b8ae081994c681cca Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 28 May 2020 11:57:41 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20issue=20so=20PATH=20directories=20aren?= =?UTF-8?q?=E2=80=99t=20added=20each=20time=20fish=20starts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- org/config/fish.org | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/org/config/fish.org b/org/config/fish.org index 92b5875..7259a3c 100644 --- a/org/config/fish.org +++ b/org/config/fish.org @@ -232,9 +232,9 @@ :CUSTOM_ID: h-a9c79e7c-29ea-49e0-959e-0983e886f346 :END: Some global variables might sometimes be needed and need to be modified. This - is for example the case with my =PATH= variable in which I add Rust’s Cargo’s + is for example the case with my ~PATH~ variable in which I add Rust’s Cargo’s binaries, Go’s binaries and my own executables. And of course, don’t forget - to add the already existing =PATH=. + to add the already existing ~PATH~. #+NAME: extra-paths | additional path | what it leads to | @@ -252,11 +252,17 @@ paths " ") #+END_SRC - #+RESULTS[d6cf1e9d562d644db1bc6458eca1fc165b065f0c]: generate-extra-paths - : $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin $HOME/.gem/ruby/2.6.0/bin + #+RESULTS[f1fff053cb9e2239f35571249763683a4a62e643]: generate-extra-paths + : $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin $HOME/.gem/ruby/2.6.0/bin $HOME/.cabal/bin + The code below ensures the ~PATH~ is updated only at login, and every + location is addded only once. #+BEGIN_SRC fish :noweb yes - set -gx PATH <> $PATH + for p in <> + if status is-login + contains $p $PATH || set PATH $PATH $p + end + end #+END_SRC * Abbreviations