Skip to content

Commit

Permalink
Merge pull request coreybutler#967 from nineninesevenfour/fix-spaces-…
Browse files Browse the repository at this point in the history
…build-bat

allow to run build.bat on paths with spaces
  • Loading branch information
coreybutler authored Oct 10, 2023
2 parents 9c37af6 + 2dad26d commit 4b31ca3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ cd .\src
go build nvm.go

REM Group the file with the helper binaries
move nvm.exe %GOBIN%
move nvm.exe "%GOBIN%"
cd ..\

REM Codesign the executable
echo ----------------------------
echo Sign the nvm executable...
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %GOBIN%\nvm.exe
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a "%GOBIN%\nvm.exe"

for /f %%i in ('"%GOBIN%\nvm.exe" version') do set AppVersion=%%i
echo nvm.exe v%AppVersion% built.
Expand All @@ -35,7 +35,7 @@ REM Create the distribution folder
SET DIST=%CD%\dist\%AppVersion%

REM Remove old build files if they exist.
if exist %DIST% (
if exist "%DIST%" (
echo ----------------------------
echo Clearing old build in %DIST%
echo ----------------------------
Expand All @@ -54,7 +54,7 @@ echo Generating update utility...
echo ----------------------------
cd .\updater
go build nvm-update.go
move nvm-update.exe %DIST%
move nvm-update.exe "%DIST%"
cd ..\

REM Generate the installer (InnoSetup)
Expand All @@ -66,12 +66,12 @@ buildtools\iscc "%INNOSETUP%" "/o%DIST%"
echo ----------------------------
echo Sign the installer
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %DIST%\nvm-setup.exe
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a "%DIST%\nvm-setup.exe"

echo ----------------------------
echo Sign the updater...
echo ----------------------------
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a %DIST%\nvm-update.exe
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a "%DIST%\nvm-update.exe"

echo ----------------------------
echo Bundle the installer...
Expand All @@ -84,20 +84,20 @@ echo Bundle the updater...
echo ----------------------------
buildtools\zip -j -9 -r "%DIST%\nvm-update.zip" "%DIST%\nvm-update.exe"

del %DIST%\nvm-update.exe
del %DIST%\nvm-setup.exe
del "%DIST%\nvm-update.exe"
del "%DIST%\nvm-setup.exe"

REM Generate checksums
echo ----------------------------
echo Generating checksums...
echo ----------------------------
for %%f in (%DIST%\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")
for %%f in ("%DIST%"\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")
echo complete

echo ----------------------------
echo Cleaning up...
echo ----------------------------
del %GOBIN%\nvm.exe
del "%GOBIN%\nvm.exe"
echo complete
@REM del %GOBIN%\nvm-update.exe
@REM del %GOBIN%\nvm-setup.exe
Expand Down

0 comments on commit 4b31ca3

Please sign in to comment.