aboutsummaryrefslogtreecommitdiff
path: root/util/qmk_install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/qmk_install.sh')
-rwxr-xr-xutil/qmk_install.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/util/qmk_install.sh b/util/qmk_install.sh
new file mode 100755
index 000000000..5f22ba0ad
--- /dev/null
+++ b/util/qmk_install.sh
@@ -0,0 +1,77 @@
1#!/usr/bin/env bash
2
3QMK_FIRMWARE_DIR=$(cd -P -- "$(dirname -- "$0")/.." >/dev/null && pwd -P)
4QMK_FIRMWARE_UTIL_DIR=$QMK_FIRMWARE_DIR/util
5if [ "$1" = "-y" ]; then
6 SKIP_PROMPT='-y'
7 MSYS2_CONFIRM='--noconfirm'
8else
9 SKIP_PROMPT=''
10 MSYS2_CONFIRM=''
11fi
12
13case $(uname -a) in
14 *Darwin*)
15 . "$QMK_FIRMWARE_UTIL_DIR/install/macos.sh";;
16 *FreeBSD*)
17 . "$QMK_FIRMWARE_UTIL_DIR/install/freebsd.sh";;
18 *MINGW64_NT*)
19 . "$QMK_FIRMWARE_UTIL_DIR/install/msys2.sh";;
20 *MSYS_NT*|*MINGW32_NT*)
21 echo "Please open a MinGW64 terminal window and re-run this script."
22 exit 1;;
23 *Linux*)
24 . "$QMK_FIRMWARE_UTIL_DIR/install/linux_shared.sh"
25
26 case $(grep ID /etc/os-release) in
27 *arch*|*manjaro*)
28 . "$QMK_FIRMWARE_UTIL_DIR/install/arch.sh";;
29 *debian*|*ubuntu*)
30 . "$QMK_FIRMWARE_UTIL_DIR/install/debian.sh";;
31 *fedora*)
32 . "$QMK_FIRMWARE_UTIL_DIR/install/fedora.sh";;
33 *gentoo*)
34 . "$QMK_FIRMWARE_UTIL_DIR/install/gentoo.sh";;
35 *slackware*)
36 . "$QMK_FIRMWARE_UTIL_DIR/install/slackware.sh";;
37 *solus*)
38 . "$QMK_FIRMWARE_UTIL_DIR/install/solus.sh";;
39 *void*)
40 . "$QMK_FIRMWARE_UTIL_DIR/install/void.sh";;
41 *)
42 echo "Sorry, we don't recognize your distribution. Try using the docker image instead:"
43 echo
44 echo "https://docs.qmk.fm/#/getting_started_docker"
45 exit 1;;
46 esac
47
48 if uname -a | grep -qi microsoft; then
49 echo "********************************************************************************"
50 echo "* Detected Windows Subsystem for Linux. *"
51 echo "* Currently, WSL has no access to USB devices and so flashing from within the *"
52 echo "* WSL terminal will not work. *"
53 echo "* *"
54 echo "* Please install the QMK Toolbox instead: *"
55 echo "* https://github.com/qmk/qmk_toolbox/releases *"
56 echo "* Then, map your WSL filesystem as a network drive: *"
57 echo "* \\\\\\\\wsl$\\<distro> *"
58 echo "********************************************************************************"
59 echo
60 fi
61 ;;
62 *)
63 echo "Sorry, we don't recognize your environment. Help us by contributing support!"
64 echo
65 echo "https://docs.qmk.fm/#/contributing"
66 exit 1;;
67esac
68
69if type _qmk_install_prepare &>/dev/null; then
70 _qmk_install_prepare || exit 1
71fi
72
73_qmk_install
74
75if type _qmk_install_bootloadhid &>/dev/null; then
76 _qmk_install_bootloadhid
77fi