]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/wsl_install.sh
Fix overlong lines, and a few spelling errors
[qmk_firmware.git] / util / wsl_install.sh
1 #!/bin/bash
2
3 dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
4 pushd "$dir";
5
6 if [[ $dir != /mnt/* ]];
7 then
8     echo
9     echo "You need to clone the qmk_firmware repository outside the linux filesystem."
10     echo "Otherwise the windows executables can't be run."
11     exit 1
12 fi
13
14
15 while true; do
16     echo
17     echo "Do you want to install all toolchain dependencies needed for compiling QMK?"
18     echo "This will run install_dependencies.sh, which calls apt-get upgrade."
19     echo "If you don't want that, you can install the dependencies manually."
20     read -p "(Y/N) " res
21     case $res in
22         [Yy]* ) sudo ./install_dependencies.sh; break;;
23         [Nn]* ) break;;
24         * ) echo "Invalid answer";;
25     esac
26 done
27
28 echo "Installing dependencies needed for the installation (unzip, wget)"
29 echo "This will ask for the sudo password"
30 sudo apt-get install unzip wget
31
32 download_dir=wsl_downloaded
33
34 source "$dir/win_shared_install.sh"
35
36 echo 
37 echo "Creating a softlink to the utils directory as ~/qmk_utils."
38 echo "This is needed so that the the make system can find all utils it need."
39 read -p "Press any key to continue (ctrl-c to abort)"
40 ln -sfn "$dir" ~/qmk_utils
41
42 if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc
43 then
44     echo
45     echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc"
46     echo "Not adding it twice"
47 else
48     while true; do
49         echo
50         echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your"
51         echo ".bashrc file? Without this make won't find the needed utils, so if you don't"
52         echo "want to do it automatically, then you have to do it manually later."
53         read -p "(Y/N)? " res
54         case $res in
55             [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;;
56             [Nn]* ) break;;
57             * ) echo "Invalid answer";;
58         esac
59     done
60 fi
61
62 while true; do
63     echo
64     echo "Do you want to add a symlink to the QMK repository in your home directory for"
65     echo "convenience? This will create a folder 'qmk_firmware' in your home directory."
66     echo "In the future you can use this folder instead of the full path on your Windows"
67     echo "file system."
68     read -p "(Y/N)? " res
69     case $res in
70         [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;;
71         [Nn]* ) break;;
72         * ) echo "Invalid answer";;
73     esac
74 done
75
76 echo
77 echo "******************************************************************************"
78 echo "Installation completed!"
79 echo "You need to open a new batch command prompt for all the utils to work properly"
80 echo "******************************************************************************"
81
82 popd > /dev/null