dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 3fabe5452179e9cfa91a1539af997866492a4a3e
parent e090f2cf4b5f3fd3042f31d480d91bab43de8b9f
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 20 Nov 2020 13:49:10 -0500

rc profile: be smart about adding to $PATH

Diffstat:
Mlib/profile | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/profile b/lib/profile @@ -1,6 +1,13 @@ +fn addpath { + if(~ $PATH *^$1^*) {} + if not { + PATH=$PATH:$1 + } +} + fn %{ $* } font=/lib/font/bit/lucsans/unicode.7.font -PATH=$PATH:$home/bin +addpath $home/bin HOSTNAME=`{hostname | cut -d. -f1} LANG=en_US.UTF-8 XDG_CONFIG_HOME=$home/etc @@ -13,7 +20,7 @@ TMPDIR=$home/tmp switch($HOSTNAME) { case carbon PLAN9=/usr/local/plan9 - PATH=$PATH:$PLAN9/bin + addpath $PLAN9/bin BROWSER=firefox-esr EDITOR=E PAGER=nobs @@ -28,3 +35,5 @@ case carbon exec startx } } + +fn addpath