-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·37 lines (36 loc) · 1.05 KB
/
install.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
#!/bin/bash
# Set up environment ready for make3dgp
# usage: ./install <install_dir>
if [ -z "$1" ]; then
if [ -f ~/.bashrc ]; then
echo "export PATH=\$PATH:${PWD}" >> ~/.bashrc
echo "export GP3DSOURCELOC='${PWD}'" >> ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
echo "export PATH=\$PATH:${PWD}" >> ~/.bash_profile
echo "export GP3DSOURCELOC='${PWD}'" >> ~/.bash_profile
fi
if [ -f ~/.cshrc ]; then
echo "set path = ( \$path ${PWD} )" >> ~/.cshrc
echo "setenv GP3DSOURCELOC '${PWD}'" >> ~/.cshrc
fi
else
mkdir $1
if [ $? == 0 ]; then
fullpath=`readlink -f $1`
cp *.f90 $fullpath
cp make3dgp Makefile $fullpath
if [ -f ~/.bashrc ]; then
echo "export PATH=\$PATH:$fullpath" >> ~/.bashrc
echo "export GP3DSOURCELOC='$fullpath'" >> ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
echo "export PATH=\$PATH:$fullpath" >> ~/.bashrc
echo "export GP3DSOURCELOC='$fullpath'" >> ~/.bashrc
fi
if [ -f ~/.cshrc ]; then
echo "set path = ( \$path $fullpath )" >> ~/.cshrc
echo "setenv GP3DSOURCELOC '$fullpath'" >> ~/.cshrc
fi
fi
fi