mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-02-01 22:21:13 +00:00
add version module
This commit is contained in:
parent
641ded49d8
commit
6c66b2857c
@ -4,21 +4,20 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
_ "embed"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/xvzc/SpoofDPI/proxy"
|
||||
"github.com/xvzc/SpoofDPI/util"
|
||||
"github.com/xvzc/SpoofDPI/version"
|
||||
)
|
||||
|
||||
var VERSION = "v0.0.0(dev)"
|
||||
func main() {
|
||||
util.ParseArgs()
|
||||
config := util.GetConfig()
|
||||
if *config.Version {
|
||||
println("spoog-dpi", VERSION)
|
||||
println("\nA simple and fast anti-censorship tool written in Go.")
|
||||
println("https://github.com/xvzc/SpoofDPI")
|
||||
PrintVersion()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION="v0.10.6"
|
||||
|
||||
for osarch in 'darwin/amd64' 'darwin/arm64' 'linux/amd64' 'linux/arm' 'linux/arm64' 'linux/mips' 'linux/mipsle'; do
|
||||
GOOS=${osarch%/*} GOARCH=${osarch#*/} go build -ldflags="-w -s -X main.VERSION=${VERSION}" github.com/xvzc/SpoofDPI/cmd/spoof-dpi &&
|
||||
tar -zcvf spoof-dpi-${osarch%/*}-${osarch#*/}.tar.gz ./spoof-dpi &&
|
||||
|
12
version.go
Normal file
12
version.go
Normal file
@ -0,0 +1,12 @@
|
||||
package version
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed .version
|
||||
var VERSION string
|
||||
|
||||
func PrintVersion() {
|
||||
println("spoof-dpi", VERSION)
|
||||
println("A simple and fast anti-censorship tool written in Go.")
|
||||
println("https://github.com/xvzc/SpoofDPI")
|
||||
}
|
Loading…
Reference in New Issue
Block a user