Add clearer logging to buildfile

This commit is contained in:
coreybutler
2021-12-15 20:08:14 -06:00
parent 3fcb3d48e1
commit 1f7a706a66

View File

@@ -12,7 +12,9 @@ if exist src\nvm.exe (
)
REM Make the executable and add to the binary directory
echo ----------------------------
echo Building nvm.exe
echo ----------------------------
cd .\src
go build nvm.go
@@ -21,7 +23,9 @@ 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
for /f %%i in ('"%GOBIN%\nvm.exe" version') do set AppVersion=%%i
@@ -32,7 +36,9 @@ SET DIST=%CD%\dist\%AppVersion%
REM Remove old build files if they exist.
if exist %DIST% (
echo ----------------------------
echo Clearing old build in %DIST%
echo ----------------------------
rd /s /q "%DIST%"
)
@@ -43,35 +49,58 @@ REM Create the "no install" zip version
for %%a in ("%GOBIN%") do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" %%a\* -x "%GOBIN%\nodejs.ico")
REM Generate update utility
echo ----------------------------
echo Generating update utility...
echo ----------------------------
cd .\updater
go build nvm-update.go
echo Sign the updater...
buildtools\signtool.exe sign /debug /tr http://timestamp.sectigo.com /td sha256 /fd sha256 /a nvm-update.exe
move nvm-update.exe %DIST%
cd ..\
REM Generate the installer (InnoSetup)
echo ----------------------------
echo Generating installer...
echo ----------------------------
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
echo Bundle the installer/updater...
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
echo ----------------------------
echo Bundle the installer...
echo ----------------------------
buildtools\zip -j -9 -r "%DIST%\nvm-setup.zip" "%DIST%\nvm-setup.exe"
echo ----------------------------
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
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")
echo complete
echo ----------------------------
echo Cleaning up...
REM Cleanup
echo ----------------------------
del %GOBIN%\nvm.exe
echo complete
@REM del %GOBIN%\nvm-update.exe
@REM del %GOBIN%\nvm-setup.exe
echo NVM for Windows v%AppVersion% build completed.
echo NVM for Windows v%AppVersion% build completed. Available in %DIST%
@echo on