forked from openepics/names
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
38 lines (30 loc) · 1 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Copyright (c) UChicago Argonne, LLC. All rights reserved.
# See LICENSE file.
# NAMES setup script for Bourne-type shells
# This file is typically sourced in user's .bashrc file
if [ -n "$BASH_SOURCE" ]; then
input_param=$BASH_SOURCE
elif [ -n "$ZSH_VERSION" ]; then
setopt function_argzero
input_param=$0
else
echo 1>&2 "Unsupported shell. Please use bash or zsh."
exit 2
fi
myDir=`dirname $input_param`
currentDir=`pwd` && cd $myDir
if [ ! -z "$NAMES_ROOT_DIR" -a "$NAMES_ROOT_DIR" != `pwd` ]; then
echo "WARNING: Resetting NAMES_ROOT_DIR environment variable (old value: $NAMES_ROOT_DIR)"
fi
export NAMES_ROOT_DIR=`pwd`
if [ -z $NAMES_INSTALL_DIR ]; then
export NAMES_INSTALL_DIR=$NAMES_ROOT_DIR/..
if [ -d $NAMES_INSTALL_DIR ]; then
cd $NAMES_INSTALL_DIR
export NAMES_INSTALL_DIR=`pwd`
fi
fi
export NAMES_SUPPORT_DIR=$NAMES_INSTALL_DIR/support-`hostname -s`
export PATH=$NAMES_SUPPORT_DIR/bin:$PATH
export PATH=$NAMES_SUPPORT_DIR/payara/glassfish/bin:$PATH