1 Star 0 Fork 465

张丽宾/go-fastdfs

forked from sjqzhang/go-fastdfs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.sh 1.62 KB
一键复制 编辑 原始数据 按行查看 历史
busyfree 提交于 2021-05-17 17:43 . change app name
#!/bin/bash
BIN_VERSION="go-fastdfs:${1-$(git describe --tags `git rev-parse HEAD`)}"
if [[ ! -d src ]];then
cp -r vendor src
fi
#for linux
GOPATH=`pwd` GOOS=linux GOARCH=amd64 go build -o fileserver -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
GOPATH=`pwd` GOOS=linux GOARCH=386 go build -o fileserver32 -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
#for windows
GOPATH=`pwd` GOOS=windows GOARCH=amd64 go build -o fileserver.exe -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
GOPATH=`pwd` GOOS=windows GOARCH=386 go build -o fileserver32.exe -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
#for mac
GOPATH=`pwd` GOOS=darwin GOARCH=amd64 go build -o fileserver_darwin -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
GOPATH=`pwd` GOOS=darwin GOARCH=386 go build -o fileserver_darwin32 -ldflags "-w -s -X 'main.VERSION=$BIN_VERSION' -X 'main.BUILD_TIME=build_time:`date`' -X 'main.GO_VERSION=`go version`' -X 'main.GIT_VERSION=git_version:`git rev-parse HEAD`'" main.go
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/zhanglibin/go-fastdfs.git
git@gitee.com:zhanglibin/go-fastdfs.git
zhanglibin
go-fastdfs
go-fastdfs
master

搜索帮助