1
0
Fork 0

Use home directory for download on msys2

This commit is contained in:
Fred Sundvik 2017-07-11 16:11:37 +03:00
parent 32fc4da4a7
commit d47db637ed
3 changed files with 15 additions and 15 deletions

View file

@ -3,7 +3,9 @@
dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
echo "Installing dependencies needed for the installation (quazip)" echo "Installing dependencies needed for the installation (quazip)"
pacman -S msys/unzip pacman --needed -S msys/unzip
export download_dir=~/qmk_utils
source "$dir/win_shared_install.sh" source "$dir/win_shared_install.sh"

View file

@ -1,13 +1,10 @@
#!/bin/bash #!/bin/bash
download_dir=win_downloaded
wsl_download_dir=wsl_downloaded
function install_utils { function install_utils {
rm -f -r $download_dir rm -f -r "$download_dir"
mkdir $download_dir mkdir "$download_dir"
pushd $download_dir pushd "$download_dir"
echo "Installing dfu-programmer" echo "Installing dfu-programmer"
wget 'http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip' wget 'http://downloads.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip'
@ -34,19 +31,15 @@ function install_utils {
} }
function install_drivers { function install_drivers {
pushd $download_dir pushd "$download_dir"
cp -f "$dir/drivers.txt" .
echo echo
cmd.exe /c "qmk_driver_installer.exe $1 $2 ..\\drivers.txt" cmd.exe /c "qmk_driver_installer.exe $1 $2 drivers.txt"
popd > /dev/null popd > /dev/null
} }
pushd "$dir" pushd "$dir"
if [ -d "$wsl_download_dir" ]; then
echo "Renaming existing wsl_download_dir to win_download"
mv -f "$wsl_download_dir" "$download_dir"
fi
if [ ! -d "$download_dir" ]; then if [ ! -d "$download_dir" ]; then
install_utils install_utils
else else
@ -61,15 +54,17 @@ else
done done
fi fi
pushd "$download_dir"
while true; do while true; do
echo echo
read -p "Flip need to be installed if you want to use that for programming, do you want to install it now? (Y/N) " res read -p "Flip need to be installed if you want to use that for programming, do you want to install it now? (Y/N) " res
case $res in case $res in
[Yy]* ) cmd.exe /c $download_dir\\FlipInstaller.exe; break;; [Yy]* ) cmd.exe /c FlipInstaller.exe; break;;
[Nn]* ) break;; [Nn]* ) break;;
* ) echo "Invalid answer";; * ) echo "Invalid answer";;
esac esac
done done
popd
while true; do while true; do

View file

@ -28,6 +28,9 @@ done
echo "Installing dependencies needed for the installation (unzip, wget)" echo "Installing dependencies needed for the installation (unzip, wget)"
echo "This will ask for the sudo password" echo "This will ask for the sudo password"
sudo apt-get install unzip wget sudo apt-get install unzip wget
download_dir=wsl_downloaded
source "$dir/win_shared_install.sh" source "$dir/win_shared_install.sh"
echo echo