-
Notifications
You must be signed in to change notification settings - Fork 115
/
run.bat
64 lines (57 loc) · 1.8 KB
/
run.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
::===========================================================
:: GNVM : Node.js version manager by GO
:: HOST : https://github.com/kenshin/gnvm
:: Author : Kenshin<kenshin@ksria.com>
:: Version: 0.0.2
::===========================================================
@echo off
::===========================================================
:: Initialize
::===========================================================
if "%1" == "icon" goto icon
if "%1" == "test" goto test
if "%1" == "install" (
if "%2" == "" goto install
if "%2" == "x86" (
set GOARCH=386
call :build %2
)
if "%2" == "x64" (
set GOARCH=amd64
call :build %2
)
)
::===========================================================
:: icon : Set icon.
::===========================================================
:icon
@echo run rsrc.exe build syso
rsrc -ico gnvm.ico -o gnvm.syso
goto quit
::===========================================================
:: install : Install current os runtime
::===========================================================
:install
@echo run go install
go install -ldflags "-w -s"
goto quit
::===========================================================
:: build : Cross compile, support x86 and x64 on Windows
::===========================================================
:build
@echo run go build %1
go build -ldflags "-w -s"
goto quit
::===========================================================
:: test : Test gnvm
::===========================================================
:test
@echo go test
go test
goto quit
::===========================================================
:: quit : Quit batch script.
::===========================================================
:quit
@echo gnvm.exe compile success.
exit /b 0