-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
40 lines (33 loc) · 981 Bytes
/
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
38
39
40
#!/bin/bash
# Installation for Unix/Linux
installation_path="/usr/local"
bin_path="${installation_path}/bin"
share_path="${installation_path}/share"
DIR="$(dirname "$(realpath "$0")")"
# Remove symbolic link if exists
sudo rm -f "${bin_path}/devstarter"
sudo mkdir -p "${share_path}/devstarter"
sudo mkdir -p "${share_path}/devstarter/templates"
sudo mkdir -p "${share_path}/devstarter/src"
if [ -d "$DIR/templates" ]; then
sudo cp -r "$DIR/templates" "${share_path}/devstarter"
else
echo "Error: missing templates/ directory"
exit 1
fi
if [ -d "$DIR/src" ]; then
sudo cp -r "$DIR/src" "${share_path}/devstarter"
else
echo "Error: missing src/ directory"
exit 1
fi
if [ -f "$DIR/sdm.sh" ]; then
sudo cp "$DIR/sdm.sh" "${share_path}/devstarter/"
else
echo "Error: missing sdm.sh file"
exit 1
fi
# Create symbolic link
sudo ln -s /usr/local/share/sdm/sdm.sh /usr/local/bin/sdm
chmod +x /usr/local/bin/sdm
echo "SDM installed without errors"