From c420edd53c56a5a9d8db08d317c7f15c82de6d17 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Tue, 5 Jan 2021 20:54:56 -0500 Subject: [PATCH] Add setup script for fish shell --- setup.fish | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 setup.fish diff --git a/setup.fish b/setup.fish new file mode 100644 index 0000000..0ad82c6 --- /dev/null +++ b/setup.fish @@ -0,0 +1,37 @@ +#!/usr/bin/fish + +function update_path -d "Remove argv[2]argv[3] from argv[1] if argv[2], and prepend argv[4]" + # Assert that we got enough arguments + if test (count $argv) -ne 4 + echo "update_path: needs 4 arguments but have " (count $argv) + return 1 + end + + set var $argv[1] + + set newpath $argv[4] + for el in $$var + if test "$argv[2]" = ""; or not test "$el" = "$argv[2]$argv[3]" + set newpath $newpath $el + end + end + + set -xg $var $newpath +end + + +if set -q HCANALYZER + set old_hcanalyzer $HCANALYZER +end + +if set -q ANALYZER + set old_analyzer $ANALYZER +end +set -x HCANALYZER (realpath (dirname (status -f))) +set -x ANALYZER $HCANALYZER/podd + +update_path LD_LIBRARY_PATH "$old_hcanalyzer" "" $HCANALYZER +update_path LD_LIBRARY_PATH "$old_analyzer" "$HCANALYZER" $ANALYZER +update_path DYLD_LIBRARY_PATH "$old_hcanalyzer" "" $HCANALYZER +update_path DYLD_LIBRARY_PATH "$old_analyzer" "$HCANALYZER" $ANALYZER + -- GitLab