-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashdb_install.sh
More file actions
38 lines (34 loc) · 1.03 KB
/
bashdb_install.sh
File metadata and controls
38 lines (34 loc) · 1.03 KB
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
#set -e
RESET='\033[0m'
COLOR='\033[1;32m'
function msg {
echo -e "${COLOR}$(date): $1${RESET}"
}
function fail {
msg "Error : $?"
exit 1
}
# Detect directory of this script
FLASH_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || fail
# Detect Bash Version
BASH_MAJOR_MINOR=$(bash --version | head -n1 | cut -d ' ' -f4 | cut -d '.' -f1,2) || fail
echo "Detected Bash version: $BASH_MAJOR_MINOR" || fail
# Install pre-requisites
sudo apt install -y autoconf automake m4 texinfo
cd $FLASH_DIR/resources || fail
git clone https://github.com/Trepan-Debuggers/bashdb.git || fail
cd bashdb || fail
git checkout bash-$BASH_MAJOR_MINOR || fail
# Make the source
echo "Installing the bash debugger"
./autogen.sh || fail
./configure || fail
make || fail
sudo make install || fail
# Check if it works
bashdb --version || fail
echo "Cleaning up the source directory!"
cd .. || fail
rm -rf bashdb || fail
echo "If this script doesnt error out, you're good to go! Meaning, if you got here, you should be set. Congrats, and goodbye!" || fail