Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Last active December 17, 2015 14:49
Show Gist options
  • Save kidpixo/5627428 to your computer and use it in GitHub Desktop.
Save kidpixo/5627428 to your computer and use it in GitHub Desktop.
[ISIS3](1) Startup file for the [fish shell](2), a command line shell for the 90s. Remember to use " set -xg $ISISROOT" in your configuration file to set is as global! [1] : http://fishshell.com/ [2] : http://isis.astrogeology.usgs.gov/
#!/opt/local/bin/fish
################################################################################
# This file should be sourced within your current shell using the ". "
# command. Since this is only a beta version we do not suggest you add this
# command to your startup file
#
# On the command line type:
# > setenv ISISROOT ????
# > cd $ISISROOT
# > . isis3Startup.csh
#
# Replace the "????" in the above command line with the path you installed
# the Isis distribution
#
#_HIST FEB 21 2006 - Jac Shinaman - USGS, Astrogeology - added code to prevent
# duplication of paths
# FEB 22 2006 - JRS - changed OsType to Platform to avoid conflicts with
# internal USGS initIsis.csh script
# JUL 12 2006 - Robert Wallace - Add ISIS3TESTDATA environment variable
# AUG 25 2008 - Kris Becker - Changed all references of DYLD_LIBRARY_PATH
# to DYLD_FALLBACK_LIBRARY_PATH. See
# http://www.osxfaq.com/man/1/dyld.ws.
# MAR 12 2009 - Christopher Austin - Changed the way ISIS3TESTDATE is set
# to prevent its setting for outside groups and default
# to "/usgs/cpkgs/isis3/testData"
# MAY 22 2013 - Mario D'Amore - Updated to work with fish
#_VER $Id: isis3Startup.sh,v 1. 2013/05/22 17:22:00 ehyer Exp $
#_END
################################################################################
#Check parameters
set QTPLUGINPATH "true"
#protection for no input > $argv wil be the name of the script.
if not contains "$ISISROOT/scripts/isis3Startup.fish" $argv
for arg in $argv
if test $arg = '-noqtpluginpath'
set QTPLUGINPATH "false"
else
echo "Uknown argument $arg"
exit 1
end
end
end
# Establish a platform switch variable
set Platform `uname -s`
# Initialize the ISISROOT environment variable if it doesn't exist
# TODO: Test is obsolete, fail if no isisroot is set
if set -q $ISISROOT !
set -x ISISROOT /usgs/pkgs/isis3/isis
end
# Initialize the ISIS3DATA environment variable
if test -d $ISISROOT/../data
set -x ISIS3DATA $ISISROOT/../data
else
set -x ISIS3DATA /usgs/cpkgs/isis3/data
end
# Initialize the ISIS3TESTDATA environment variable
if test -d /usgs/cpkgs/isis3/testData
set -x ISIS3TESTDATA /usgs/cpkgs/isis3/testData
else
if test -d $ISISROOT/../testData
set -x ISIS3TESTDATA $ISISROOT/../testData
end
end
# Insert ISISROOT/bin in the PATH environment variable if it's not already there
if set -q $PATH !
set -x PATH "$ISISROOT/bin"
else
printenv PATH | grep $ISISROOT/bin >/dev/null ^/dev/null
if test $status != 0
set -x PATH $PATH $ISISROOT/bin
end
end
# Create QT_PLUGIN_PATH env variable
if test $QTPLUGINPATH = "true"
set -x QT_PLUGIN_PATH "$ISISROOT/3rdParty/plugins"
end
set -e Platform
# seems to me ISIS3 is still using ISISXXXX and not ISIS3XXXX
# let's set ISISDATA and ISISTESTDATA, it'd not be bad if your're not using ISIS2...
set -x ISISDATA $ISIS3DATA
set -x ISISTESTDATA $ISISTESTDATA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment