pile

Not quite a web "stack"; more orderly than a web "heap", hopefully?
git clone https://git.kevinlegouguec.net/pile
Log | Files | Refs

tools.env (469B)


      1 # Hey Emacs!  -*- shell-script -*- please.
      2 
      3 test -d "${TOOLS_DIR}" || {
      4     echo >&2 "TOOLS_DIR unset đŸ™…"
      5     exit 1
      6 }
      7 
      8 _toolsadd ()
      9 {
     10     # TODO bash≥4.3: local -n
     11     local -r var=$1
     12     local -r val=${TOOLS_DIR}/install/$2
     13 
     14     local -r old=${!var:-}
     15     local -r new=${val}${old:+:${old}}
     16 
     17     eval "export ${var}=${new}"
     18 }
     19 
     20 _toolsadd PATH              bin
     21 _toolsadd CPATH             include
     22 _toolsadd LIBRARY_PATH      lib64
     23 _toolsadd LD_LIBRARY_PATH   lib64