summaryrefslogtreecommitdiff
path: root/icon/make_icon.bat
blob: 598decac54675855a401b6116f14508964211a3e (plain)
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
@ECHO OFF

IF "%GOPATH%"=="" GOTO NOGO
IF NOT EXIST %GOPATH%\bin\2goarray.exe GOTO INSTALL
:POSTINSTALL
call :create_go on On
call :create_go off Off
call :create_go blocked Blocked
call :create_go wait_0 Wait0
call :create_go wait_1 Wait1
call :create_go wait_2 Wait2
call :create_go wait_3 Wait3
GOTO DONE

:create_go
ECHO Creating %1_win.go
ECHO //+build windows > %1_win.go
ECHO. >> %1_win.go
TYPE ico\black\vpn_%1.ico | %GOPATH%\bin\2goarray %2 icon >> %1_win.go
EXIT /B

:CREATEFAIL
ECHO Unable to create output file
GOTO DONE

:INSTALL
ECHO Installing 2goarray...
go get github.com/cratonica/2goarray
IF ERRORLEVEL 1 GOTO GETFAIL
GOTO POSTINSTALL

:GETFAIL
ECHO Failure running go get github.com/cratonica/2goarray.  Ensure that go and git are in PATH
GOTO DONE

:NOGO
ECHO GOPATH environment variable not set
GOTO DONE

:DONE