add build scripts

This commit is contained in:
Benny~ 2020-03-02 21:50:04 +08:00
parent 954a55adbe
commit 6c91706ba8
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
2 changed files with 27 additions and 0 deletions

13
scripts/unix.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
cd ..
git pull
platform=$(uname -a)
if [[ $platform =~ "Darwin" ]]
then
go build -o webp-server-darwin-amd64 webp-server.go
elif [[ $platform =~ "x86_64" ]];then
go build -o webp-server-unix-amd64 webp-server.go
else
go build -o webp-server-linux-i386 webp-server.go
fi

14
scripts/windows.bat Normal file
View File

@ -0,0 +1,14 @@
cd ..
git pull
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)
:64BIT
go build -o webp-server-windows-amd64.exe webp-server.go
GOTO END
:32BIT
echo 32-bit...
go build -o webp-server-windows-i386.exe webp-server.go
GOTO END
pause