forked from coreybutler/nvm-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
33 lines (25 loc) · 945 Bytes
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
SET INNOSETUP=%CD%\nvm.iss
SET ORIG=%CD%
REM SET GOPATH=%CD%\src
SET BIN=%CD%\bin
REM Support for older architectures
SET GOARCH=386
echo Build executable
go build -o %BIN%\nvm.exe -ldflags="-X main.NvmVersion=%APPVEYOR_BUILD_VERSION%" cmd\nvm\main.go
for /f %%i in ('"%BIN%\nvm.exe" version') do set AppVersion=%%i
echo nvm.exe v%AppVersion% built.
echo Create the distribution folder
SET DIST=%CD%\dist
echo Remove old build files if they exist.
if exist %DIST% (
echo Clearing old build in %DIST%
rd /s /q "%DIST%"
)
echo Create the distribution directory
mkdir "%DIST%"
echo Create the "no install" zip version
for %%a in ("%BIN%") do (buildtools\zip -j -9 -r "%DIST%\nvm.zip" "%CD%\LICENSE" %%a\* -x "%BIN%\nodejs.ico")
echo Generate checksums
for %%f in (%DIST%\*.*) do (certutil -hashfile "%%f" MD5 | find /i /v "md5" | find /i /v "certutil" >> "%%f.checksum.txt")
echo NVM for Windows v%AppVersion% build completed.