-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLSDTT_path_adjuster.sh
104 lines (92 loc) · 2.99 KB
/
LSDTT_path_adjuster.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# A bash script used to set paths for the current terminal session
echo "Hello, I am going to ad some LSDTopoTools directories to your path."
echo "IMPORTANT: This DOES NOT modify your profile!!"
echo "It only updates paths for this session."
echo "YOU MUST RUN WITH: source LSDTT_path_adjuster.sh"
echo "Otherwise it will not work in the current session."
echo "You will need to run this script each time you start and LSDTopoTools session."
if [ -d /LSDTopoTools/ ]
then
echo "LSDTT is in the root directory."
basedir="/"
elif [ -d ~/LSDTopoTools/ ]
then
echo "LSDTT is in the home directory."
basedir="~/"
else
echo "Didn't find LSDTT. I'll assusme it is in the home directory."
basedir="~/"
fi
echo "The basedir is $basedir"
# Now start looking for the paths
echo "Looking for the analysis driver."
searchpath="LSDTopoTools/Git_projects/LSDTopoTools_AnalysisDriver/Analysis_driver"
fullpath="$basedir$searchpath"
echo "The full search path is $fullpath"
if [ -d "$fullpath/" ]
then
echo "This path exists. I will add it to the path for this session."
if [[ $PATH != *"$fullpath"* ]]
then
echo "The searchpath is not in the path. I will add it."
PATH=$PATH:$fullpath
else
echo "The searchpath is in the path."
fi
else
echo "This path is not installed."
fi
echo "Looking for the chi tools."
searchpath="LSDTopoTools/Git_projects/LSDTopoTools_ChiMudd2014/driver_functions_MuddChi2014"
fullpath="$basedir$searchpath"
echo "The full search path is $fullpath"
if [ -d "$fullpath/" ]
then
echo "This path exists. I will add it to the path for this session."
if [[ $PATH != *"$fullpath"* ]]
then
echo "The searchpath is not in the path. I will add it."
PATH=$PATH:$fullpath
else
echo "The searchpath is in the path."
fi
else
echo "This path is not installed."
fi
echo "Looking for the channel extraction tools."
searchpath="LSDTopoTools/Git_projects/LSDTopoTools_ChannelExtraction/driver_functions_ChannelExtraction"
fullpath="$basedir$searchpath"
echo "The full search path is $fullpath"
if [ -d "$fullpath/" ]
then
echo "This path exists. I will add it to the path for this session."
if [[ $PATH != *"$fullpath"* ]]
then
echo "The searchpath is not in the path. I will add it."
PATH=$PATH:$fullpath
else
echo "The searchpath is in the path."
fi
else
echo "This path is not installed."
fi
echo "Looking for the CAIRN."
searchpath="LSDTopoTools/Git_projects/LSDTopoTools_CRNBasinwide/driver_functions_CRNBasinwide"
fullpath="$basedir$searchpath"
echo "The full search path is $fullpath"
if [ -d "$fullpath/" ]
then
echo "This path exists. I will add it to the path for this session."
if [[ $PATH != *"$fullpath"* ]]
then
echo "The searchpath is not in the path. I will add it."
PATH=$PATH:$fullpath
else
echo "The searchpath is in the path."
fi
else
echo "This path is not installed."
fi
echo "The path is now:"
echo $PATH