-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
executable file
·34 lines (28 loc) · 991 Bytes
/
installer.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
#!/bin/env bash
# Check if running as root
if [[ $EUID -ne 0 ]]; then
echo -e "\n\e[31m[fail]\e[0m Please run the installer as root..."
exit 1
fi
# Check for git command to be installed
if ! command -v git &>/dev/null; then
echo -e "\n\e[31m[fail]\e[0m git command not found..."
echo -e " Please install git package before running the installer.\n"
exit 1
fi
# Remove keyboard-led-remapper directory if exists
installer_path="$RUN_AS_HOME/Keyboard-LED-Remapper"
if [[ -d "$installer_path" ]]; then
rm -rf "$installer_path"
fi
# Clone the latest version of ovos-installer git repository
git clone --quiet https://github.com/suvanbanerjee/Keyboard-LED-Remapper.git "$installer_path"
cd "$installer_path" || exit 1
# Execute the installer entrypoint
bash setup.sh "$@"
# Delete Keyboard-LED-Remapper directory once the installer is successful
exit_status="$?"
if [ "$exit_status" -eq 0 ]; then
cd "$RUN_AS_HOME" || exit 1
rm -rf "$installer_path"
fi