Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
make windows: enclose all paths in double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ceh committed May 4, 2015
1 parent 0074f64 commit b38d8af
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ REM any common errors.
set _vetExitCode=0
set _VAULT_PKG_DIRS=%TEMP%\vault-pkg-dirs.txt

go list -f {{.Dir}} ./... >%_VAULT_PKG_DIRS%
go list -f {{.Dir}} ./... >"%_VAULT_PKG_DIRS%"
REM Skip the first row, which is the main vault package (.*github.com/hashicorp/vault$)
for /f "delims= skip=1" %%d in (%_VAULT_PKG_DIRS%) do (
go tool vet %_VETARGS% %%d
for /f "delims= skip=1" %%d in ("%_VAULT_PKG_DIRS%") do (
go tool vet %_VETARGS% "%%d"
if ERRORLEVEL 1 set _vetExitCode=1
call :setMaxExitCode %_vetExitCode%
)
del /f %_VAULT_PKG_DIRS% 2>NUL
del /f "%_VAULT_PKG_DIRS%" 2>NUL
if %_vetExitCode% equ 0 exit /b %_EXITCODE%
echo.
echo Vet found suspicious constructs. Please check the reported constructs
Expand Down
32 changes: 16 additions & 16 deletions scripts/windows/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ set _GIT_DIRTY_FILE=%TEMP%\vault-git_dirty.txt
set _NUL_CMP_FILE=%TEMP%\vault-nul_cmp.txt
type nul >%_NUL_CMP_FILE%

git rev-parse HEAD >%_GIT_COMMIT_FILE%
set /p _GIT_COMMIT=<%_GIT_COMMIT_FILE%
git rev-parse HEAD >"%_GIT_COMMIT_FILE%"
set /p _GIT_COMMIT=<"%_GIT_COMMIT_FILE%"
del /f "%_GIT_COMMIT_FILE%" 2>nul

set _GIT_DIRTY=
git status --porcelain >%_GIT_DIRTY_FILE%
fc %_GIT_DIRTY_FILE% %_NUL_CMP_FILE% >nul
git status --porcelain >"%_GIT_DIRTY_FILE%"
fc "%_GIT_DIRTY_FILE%" "%_NUL_CMP_FILE%" >nul
if errorlevel 1 set _GIT_DIRTY=+CHANGES
del /f "%_GIT_DIRTY_FILE%" 2>nul
del /f "%_NUL_CMP_FILE%" 2>nul
Expand All @@ -46,19 +46,19 @@ if not %_DEV_BUILD% equ 1 goto build

set _ORIGINAL_GOPATH=%GOPATH%
set _GODEP_PATH_FILE=%TEMP%\vault-godep-path.txt
godep path >%_GODEP_PATH_FILE%
set /p GOPATH=<%_GODEP_PATH_FILE%
godep path >"%_GODEP_PATH_FILE%"
set /p GOPATH=<"%_GODEP_PATH_FILE%"
del /f "%_GODEP_PATH_FILE%" 2>nul
set GOPATH=%GOPATH%;%_ORIGINAL_GOPATH%

:devbuild
echo ==^> Preparing for development build...
set _GO_ENV_TMP_FILE=%TEMP%\vault-go-env.txt
go env GOARCH >%_GO_ENV_TMP_FILE%
set /p _XC_ARCH=<%_GO_ENV_TMP_FILE%
go env GOARCH >"%_GO_ENV_TMP_FILE%"
set /p _XC_ARCH=<"%_GO_ENV_TMP_FILE%"
del /f "%_GO_ENV_TMP_FILE%" 2>nul
go env GOOS >%_GO_ENV_TMP_FILE%
set /p _XC_OS=<%_GO_ENV_TMP_FILE%
go env GOOS >"%_GO_ENV_TMP_FILE%"
set /p _XC_OS=<"%_GO_ENV_TMP_FILE%"
del /f "%_GO_ENV_TMP_FILE%" 2>nul

:build
Expand All @@ -78,16 +78,16 @@ if %_EXITCODE% equ 1 exit /b %_EXITCODE%

set _GO_ENV_TMP_FILE=%TEMP%\vault-go-env.txt

go env GOPATH >%_GO_ENV_TMP_FILE%
set /p _GOPATH=<%_GO_ENV_TMP_FILE%
go env GOPATH >"%_GO_ENV_TMP_FILE%"
set /p _GOPATH=<"%_GO_ENV_TMP_FILE%"
del /f "%_GO_ENV_TMP_FILE%" 2>nul

go env GOARCH >%_GO_ENV_TMP_FILE%
set /p _GOARCH=<%_GO_ENV_TMP_FILE%
go env GOARCH >"%_GO_ENV_TMP_FILE%"
set /p _GOARCH=<"%_GO_ENV_TMP_FILE%"
del /f "%_GO_ENV_TMP_FILE%" 2>nul

go env GOOS >%_GO_ENV_TMP_FILE%
set /p _GOOS=<%_GO_ENV_TMP_FILE%
go env GOOS >"%_GO_ENV_TMP_FILE%"
set /p _GOOS=<"%_GO_ENV_TMP_FILE%"
del /f "%_GO_ENV_TMP_FILE%" 2>nul

REM Copy our OS/Arch to the bin/ directory
Expand Down

0 comments on commit b38d8af

Please sign in to comment.