From 8bf2f8ca0fdf78e36ae0b36bcf660c57af43e5ef Mon Sep 17 00:00:00 2001 From: reksarka Date: Thu, 26 Oct 2023 01:54:32 +0300 Subject: [PATCH] FIX: `which which` -> `which destination` For the case when a third-party `which` is available. Used to ensure that `utils` in %PATH%. --- get-sdk.bat | 2 +- get-vsix.bat | 2 +- sdk/extract-components.bat | 1 + utils/download.bat | 2 +- utils/ensure-lessmsi.bat | 2 +- utils/unzip.bat | 2 +- vsget.bat | 3 ++- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/get-sdk.bat b/get-sdk.bat index 7fa3500..a14d2be 100644 --- a/get-sdk.bat +++ b/get-sdk.bat @@ -12,7 +12,7 @@ rem -------------------------------------------------------------------------- setlocal -call which which >NUL 2>&1 || set "PATH=%~dp0utils;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%~dp0utils;%PATH%" call which check-components >NUL 2>&1 || set "PATH=%~dp0sdk;%PATH%" set url=%~1 diff --git a/get-vsix.bat b/get-vsix.bat index dd899cd..c543e57 100644 --- a/get-vsix.bat +++ b/get-vsix.bat @@ -12,7 +12,7 @@ rem -------------------------------------------------------------------------- setlocal -call which which >NUL 2>&1 || set "PATH=%~dp0utils;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%~dp0utils;%PATH%" set url=%~1 call destination "%~2" || exit /b 1 diff --git a/sdk/extract-components.bat b/sdk/extract-components.bat index 9a89bde..bc1407e 100644 --- a/sdk/extract-components.bat +++ b/sdk/extract-components.bat @@ -53,6 +53,7 @@ for %%i in ("%installers%\*.msi") do ( echo - %%~ni lessmsi x "%%i" >> lessmsi.log || ( echo [ERR][%~n0] Unable to extract SDK Component! + echo [INFO][%~n0] See "%components%\lessmsi.log". cd /d "%origin_path%" exit /b 3 ) diff --git a/utils/download.bat b/utils/download.bat index 92c900c..7eb6579 100644 --- a/utils/download.bat +++ b/utils/download.bat @@ -24,7 +24,7 @@ if exist "%outfile%" ( ) rem Utility preset. -call which which >NUL 2>&1 || set "PATH=%root%;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%root%;%PATH%" rem Ensure the %outfile% dir exists. for %%i in ("%outfile%") do if not exist "%%~dpi" md "%%~dpi" diff --git a/utils/ensure-lessmsi.bat b/utils/ensure-lessmsi.bat index c6adcb5..94a1ffb 100644 --- a/utils/ensure-lessmsi.bat +++ b/utils/ensure-lessmsi.bat @@ -19,7 +19,7 @@ set LESSMSI_DOWNLOAD=https://github.com/activescott/lessmsi/releases/download set LESSMSI_URL=%LESSMSI_DOWNLOAD%/%LESSMSI_VER%/%LESSMSI_ZIP% rem Abs path expected! -call which which >NUL 2>&1 || set "PATH=%~dp0;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%~dp0;%PATH%" call destination "%~1" || exit /b 1 echo. diff --git a/utils/unzip.bat b/utils/unzip.bat index 9e833a7..9cd0d65 100644 --- a/utils/unzip.bat +++ b/utils/unzip.bat @@ -5,7 +5,7 @@ setlocal set zip=%~1 set destination=%~2 -call which which >NUL 2>&1 || set "PATH=%~dp0;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%~dp0;%PATH%" call which 7z >NUL 2>&1 && ( 7z x -y -o"%destination%" "%zip%" >NUL || exit /b 1 diff --git a/vsget.bat b/vsget.bat index 468e096..44900ef 100644 --- a/vsget.bat +++ b/vsget.bat @@ -19,11 +19,12 @@ set MSBUILD_GROUP=msbuild-x64.%MSBUILD_V% rem Windows SDK v10.0.22621.755 set SDK_URL=https://go.microsoft.com/fwlink/?linkid=2196240 +rem VC Vars for Host x64 and Platform x64 set VCVARS=vcvars-x64-x64 set root=%~dp0 -call which which >NUL 2>&1 || set "PATH=%root%utils;%PATH%" +call which destination >NUL 2>&1 || set "PATH=%root%utils;%PATH%" call which get-vsix-group >NUL 2>&1 || set "PATH=%root%;%PATH%" call destination "%~1" || exit /b 1