From fe0b587b1fe98bda97fe12b268ef903b3f64ecf5 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 22 May 2020 16:46:55 +0800 Subject: [PATCH] make.bat: optimize vc download --- .gitignore | 1 + make.bat | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 754a028f46..79125ef272 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ a.out .noprefix.vrepl_temp # ignore v build files +/vc /v.c /v.*.c /v.c.out diff --git a/make.bat b/make.bat index 52f989cca1..a7c808cc50 100644 --- a/make.bat +++ b/make.bat @@ -5,12 +5,15 @@ echo Building V pushd %~dp0 if exist "vc" ( - rd /s /q vc + echo Updating vc... + cd vc + git pull + cd .. +) else ( + echo Cloning vc... + git clone --depth 1 --quiet https://github.com/vlang/vc ) -echo Downloading v.c... -git clone --depth 1 --quiet https://github.com/vlang/vc - REM option to force msvc or gcc if "%~1"=="-gcc" goto :gcc_strap if "%~1"=="-msvc" goto :msvc_strap @@ -39,11 +42,9 @@ REM and it will be restored when v is a stable version. v.exe self if %ERRORLEVEL% NEQ 0 ( echo v.exe failed to compile itself - Create an issue at 'https://github.com/vlang' - rd /s /q vc goto :error ) -rd /s /q vc del v_old.exe goto :success @@ -81,12 +82,10 @@ REM and it will be restored when v is a stable version. v.exe self if %ERRORLEVEL% NEQ 0 ( echo V failed to build itself with error %ERRORLEVEL% - rd /s /q vc del %ObjFile% goto :compile_error ) -rd /s /q vc del v_old.exe del %ObjFile%