Created
May 4, 2024 17:16
-
-
Save t-mat/67775f8b0b8e91dd5ca6e41ae8cc0ad6 to your computer and use it in GitHub Desktop.
[Windows] Download and run Alpine Linux on WSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal EnableDelayedExpansion | |
set /a errorno=1 | |
for /F "delims=#" %%E in ('"prompt #$E# & for %%E in (1) do rem"') do set "_ESC=%%E" | |
cd /d "%~dp0" | |
set /a _E =0 | |
set /a _E+=1 && if not exist "Alpine.zip" ( curl -JOL https://github.com/yuk7/AlpineWSL/releases/download/3.18.4-0/Alpine.zip ) | |
set /a _E+=1 && if not exist "Alpine.zip" goto :ERROR | |
set /a _E+=1 && if not exist "Alpine.exe" ( tar -xkf .\Alpine.zip ) | |
set /a _E+=1 && if not exist "Alpine.exe" goto :ERROR | |
set /a _E+=1 && .\Alpine.exe || goto :ERROR | |
echo %_ESC%[2K %~n0 : Status =%_ESC%[92m OK %_ESC%[0m | |
set /a errorno=0 | |
goto :END | |
:ERROR | |
echo %_ESC%[2K %~n0 : ErrorCode = %_E% | |
echo %_ESC%[2K %~n0 : Status =%_ESC%[91m NG %_ESC%[0m | |
set /a errorno=1 | |
:END | |
exit /B %errorno% |
Author
t-mat
commented
May 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment