Commit | Line | Data |
---|---|---|
28a4e905 FS |
1 | #!/bin/bash |
2 | ||
a25dd58b | 3 | util_dir=$(dirname "$0") |
4 | dir=$(cd -P -- "$util_dir" && pwd -P) | |
a2d3fc98 | 5 | pushd "$dir"; |
28a4e905 | 6 | |
aa264644 FS |
7 | if [[ $dir != /mnt/* ]]; |
8 | then | |
9 | echo | |
10 | echo "You need to clone the qmk_firmware repository outside the linux filesystem." | |
11 | echo "Otherwise the windows executables can't be run." | |
12 | exit 1 | |
13 | fi | |
28a4e905 | 14 | |
28a4e905 | 15 | |
9c582fc7 FS |
16 | while true; do |
17 | echo | |
18 | echo "Do you want to install all toolchain dependencies needed for compiling QMK?" | |
9c582fc7 FS |
19 | echo "If you don't want that, you can install the dependencies manually." |
20 | read -p "(Y/N) " res | |
21 | case $res in | |
11c4c711 | 22 | [Yy]* ) ./linux_install.sh; break;; |
9c582fc7 FS |
23 | [Nn]* ) break;; |
24 | * ) echo "Invalid answer";; | |
25 | esac | |
26 | done | |
27 | ||
d47db637 FS |
28 | download_dir=wsl_downloaded |
29 | ||
a2d3fc98 | 30 | source "$dir/win_shared_install.sh" |
3d3999d8 | 31 | |
a25dd58b | 32 | pip3 install -r ${util_dir}/../requirements.txt |
33 | ||
0d9e7f63 FS |
34 | pushd "$download_dir" |
35 | while true; do | |
36 | echo | |
37 | echo "Flip need to be installed if you want to use that for programming." | |
38 | echo "Please install it to the default location!" | |
39 | read -p "Do you want to install it now? (Y/N) " res | |
40 | case $res in | |
41 | [Yy]* ) cmd.exe /c FlipInstaller.exe; break;; | |
42 | [Nn]* ) break;; | |
43 | * ) echo "Invalid answer";; | |
44 | esac | |
45 | done | |
46 | popd | |
47 | ||
48 | ||
86108709 FS |
49 | echo |
50 | echo "Creating a softlink to the utils directory as ~/qmk_utils." | |
51 | echo "This is needed so that the the make system can find all utils it need." | |
7bcf3e27 | 52 | read -p "Press enter to continue (ctrl-c to abort)" |
86108709 FS |
53 | ln -sfn "$dir" ~/qmk_utils |
54 | ||
55 | if grep "^source ~/qmk_utils/activate_wsl.sh$" ~/.bashrc | |
56 | then | |
57 | echo | |
58 | echo "The line source ~/qmk_utils/activate_wsl.sh is already added to your /.bashrc" | |
59 | echo "Not adding it twice" | |
60 | else | |
61 | while true; do | |
62 | echo | |
b85ce4ce FS |
63 | echo "Do you want to add 'source ~/qmk_utils/activate_wsl.sh' to the end of your" |
64 | echo ".bashrc file? Without this make won't find the needed utils, so if you don't" | |
65 | echo "want to do it automatically, then you have to do it manually later." | |
86108709 FS |
66 | read -p "(Y/N)? " res |
67 | case $res in | |
68 | [Yy]* ) echo "source ~/qmk_utils/activate_wsl.sh" >> ~/.bashrc; break;; | |
69 | [Nn]* ) break;; | |
70 | * ) echo "Invalid answer";; | |
71 | esac | |
72 | done | |
73 | fi | |
74 | ||
75 | while true; do | |
76 | echo | |
b85ce4ce FS |
77 | echo "Do you want to add a symlink to the QMK repository in your home directory for" |
78 | echo "convenience? This will create a folder 'qmk_firmware' in your home directory." | |
79 | echo "In the future you can use this folder instead of the full path on your Windows" | |
80 | echo "file system." | |
86108709 FS |
81 | read -p "(Y/N)? " res |
82 | case $res in | |
83 | [Yy]* ) ln -sfn "$dir/.." ~/qmk_firmware; break;; | |
84 | [Nn]* ) break;; | |
85 | * ) echo "Invalid answer";; | |
86 | esac | |
87 | done | |
88 | ||
89 | echo | |
90 | echo "******************************************************************************" | |
91 | echo "Installation completed!" | |
7bcf3e27 | 92 | echo "You need to open a new bash command prompt for all the utils to work properly" |
86108709 FS |
93 | echo "******************************************************************************" |
94 | ||
aa264644 | 95 | popd > /dev/null |