forked from LSDtopotools/LSDTopoTools2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsdtt2_setup.sh
59 lines (49 loc) · 1.52 KB
/
lsdtt2_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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# This is a startup script for LSDTopoTools
# It clones the LSDTopoTools2 repository into your home directory
# it then builds the code from there.
# Author: SMM
# Date: 15/10/2018
# Set up the inital directory
BASE_DIR=$HOME
if [ BASE_DIR=="/root" ]
then
BASE_DIR=""
fi
echo "Base dir is"
SRC_DIR="$BASE_DIR/LSDTopoTools/LSDTopoTools2/src/"
LSD_DIR="$BASE_DIR/LSDTopoTools"
WRK_DIR="$BASE_DIR/LSDTopoTools/LSDTopoTools2"
echo "Source dir is: $SRC_DIR"
echo "LSD dir is: $LSD_DIR"
# Make the LSDTopoTools directory if it doesn't exist
if [ -f $LSD_DIR ]
then
echo "LSDTopoTools directory exists!"
else
echo "LSDTopoTools directory doesnt' exist. I'm making one"
mkdir $LSD_DIR
fi
# clone or pull the repo, depending on what is in there
# check if the files have been cloned
if [ -f $SRC_DIR/LSDRaster.cpp ]
then
echo "The LSDTopoTools2 repository exists, updating to the latest version."
git --work-tree=$WRK_DIR --git-dir=$WRK_DIR.git pull origin master
else
echo "Cloning the LSDTopoTools2 repository"
git clone https://github.com/LSDtopotools/LSDTopoTools2.git $WRK_DIR
fi
# Change the working directory to that of LSDTopoTools2/src
#echo "I am going to try to build LSDTopoTools2."
cd $SRC_DIR
echo "The current directory is:"
echo $PWD
echo "Calling the build script."
sh build.sh
# Now update the path
echo "Now I'll add the LSDTopoTools command line programs to your path."
export PATH=$BASE_DIR/LSDTopoTools/LSDTopoTools2/bin:$PATH
echo "Your path is now:"
echo $PATH
exec /bin/bash