Skip to content

Commit

Permalink
FIX: which which -> which destination
Browse files Browse the repository at this point in the history
For the case when a third-party `which` is available.

Used to ensure that `utils` in %PATH%.
  • Loading branch information
reksar committed Oct 25, 2023
1 parent aa3eeed commit 8bf2f8c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion get-sdk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion get-vsix.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sdk/extract-components.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion utils/download.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion utils/ensure-lessmsi.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion utils/unzip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion vsget.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8bf2f8c

Please sign in to comment.