-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·36 lines (31 loc) · 1.07 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
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Drakota's dotfiles - https://github.com/Drakota/dotfiles
Usage: $(basename "$0") [options]
Options:
-h, --help Print this help text
--with-tools Install common tools
--with-all-tools Install common and sec tools"
exit
fi
for filepath in $DIR/.* $DIR/*; do
filename=$(basename $filepath)
if [[ ! $filename =~ ^(.git|.vscode|tools|README.md|install.sh|utils.sh|.|..)$ ]]; then
ln -sfn $DIR/$filename $HOME/$filename
echo "[*] Symlinked $filename to $HOME/$filename"
fi
done
if [[ "$1" == "--with-tools" ]]; then
for filename in $DIR/tools/common/*; do
$filename
done
echo "[*] You may have to reload your current shell to have access to the installed tools"
fi
if [[ "$1" == "--with-all-tools" ]]; then
for filename in $DIR/tools/*/**; do
$filename
done
echo "[*] You may have to reload your current shell to have access to the installed tools"
fi
echo "[+] Dotfiles installed"