forked from lucastorterotot/DL_for_HTT_mass
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·26 lines (22 loc) · 855 Bytes
/
install
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
#!/bin/bash
name="DL for HTT mass reconstruction"
echo "Installing $name..."
# find where this repository is placed by getting this file's directory
instal_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
bin_dir=$instal_dir/Delphes/Delphes-3.4.2/
# check if this seems to be already installed, in this case do nothing
if [[ $PATH = *$bin_dir* ]] || [[ $(grep -l "$name" ~/.bashrc) = ~/.bashrc ]]
then
echo 'It seems like you already have installed this!'
echo 'Not changing anything.'
else
if [[ $instal_dir = $HOME* ]]
then
instal_dir=~${instal_dir#$HOME}
fi
# add the bashrc extension corresponding to this repository to your own bashrc
echo "" >> ~/.bashrc
echo "# --- add $name ---" >> ~/.bashrc
echo ". $instal_dir/bashrc_ext" >> ~/.bashrc
echo "Installation completed."
fi