aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/msys2_install.sh42
1 files changed, 40 insertions, 2 deletions
diff --git a/util/msys2_install.sh b/util/msys2_install.sh
index aed6c42bd..1b99806b5 100644
--- a/util/msys2_install.sh
+++ b/util/msys2_install.sh
@@ -1,14 +1,52 @@
1#!/bin/bash 1#!/bin/bash
2 2
3dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) 3dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4download_dir=~/qmk_utils
5avrtools=avr8-gnu-toolchain
4 6
5echo "Installing dependencies needed for the installation (quazip)" 7echo "Installing dependencies needed for the installation (quazip)"
6pacman --needed -S msys/unzip 8pacman --needed -S msys/unzip msys/p7zip
9
7 10
8export download_dir=~/qmk_utils
9 11
10source "$dir/win_shared_install.sh" 12source "$dir/win_shared_install.sh"
11 13
14function install_avr {
15 rm -f -r "$avrtools"
16 wget "http://www.atmel.com/images/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe"
17 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
18 rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe
19}
20
21pushd "$download_dir"
22
23
24if [ ! -d "$avrtools" ]; then
25 while true; do
26 echo
27 echo "The AVR toolchain is not installed."
28 echo "This is needed for building AVR based keboards."
29 read -p "Do you want to install it? (Y/N) " res
30 case $res in
31 [Yy]* ) install_avr; break;;
32 [Nn]* ) break;;
33 * ) echo "Invalid answer";;
34 esac
35 done
36else
37 while true; do
38 echo
39 echo "The AVR toolchain is already installed"
40 read -p "Do you want to reinstall? (Y/N) " res
41 case $res in
42 [Yy]* ) install_avr; break;;
43 [Nn]* ) break;;
44 * ) echo "Invalid answer";;
45 esac
46 done
47fi
48popd
49
12echo 50echo
13echo "******************************************************************************" 51echo "******************************************************************************"
14echo "Installation completed!" 52echo "Installation completed!"