-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·42 lines (35 loc) · 1 KB
/
init.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
cmake -S . -B ./build
cd build/
nice make -j4 && cp ./buildProject ..
cd ..
sudo cp ./buildProject /usr/bin/buildProject
BUILD_DIR="$(pwd)/build"
STARTUP_DIR="$(pwd)/startup"
LINK=$HOME/.local/share/zinit/completions/_buildProject
DATA_DIR=$HOME/.local/share/projectBuilder
mkdir -p $DATA_DIR/helpers
cp $(pwd)/helpers/* $DATA_DIR/helpers
if [[ $SHELL = "/usr/bin/zsh" || $SHELL = "/bin/zsh" ]]; then
echo "export PATH=\"$PATH:$BUILD_DIR\"" >> $HOME/.zshrc
if [[ ! -f $LINK ]]; then
ln -s $STARTUP_DIR/_buildProject.zsh $LINK
fi
. ~/.zshrc
elif [[ $SHELL = "/bin/bash" ]]; then
echo "export PATH=\"\$PATH:$BUILD_DIR\"" >> $HOME/.bashrc
echo "source $STARTUP_DIR/init.bash" >> $HOME/.bashrc
. ~/.bashrc
fi
read -p "Do you want to generate documentation? [Y/n]: " i
if [[ $i == "n" ]]; then
exit 0
fi
which doxygen
if [[ $? != 0 ]]; then
sudo apt install doxygen -y
fi
cd ./doc
doxygen config &> /dev/null
cd man/man3
PAGE=$(ls ../../.. -1 | grep md)
sudo cp ../../../$PAGE /usr/share/man/man3/buildProject.3