diff --git a/go.mod b/go.mod index 4fa770515..a24bde24f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/scripthaus-dev/mshell -go 1.17 +go 1.18 require ( github.com/alessio/shellescape v1.4.1 diff --git a/main-mshell.go b/main-mshell.go index bb41760b3..b6b8ab331 100644 --- a/main-mshell.go +++ b/main-mshell.go @@ -22,6 +22,8 @@ import ( "golang.org/x/sys/unix" ) +var BuildTime = "-" + // func doMainRun(pk *packet.RunPacketType, sender *packet.PacketSender) { // err := shexec.ValidateRunPacket(pk) // if err != nil { diff --git a/scripthaus.md b/scripthaus.md index bc58b302f..39b267877 100644 --- a/scripthaus.md +++ b/scripthaus.md @@ -1,16 +1,18 @@ ```bash # @scripthaus command build -go build -ldflags="-s -w" -o bin/mshell-v0.2-darwin.amd64 main-mshell.go +GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" +go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.2-darwin.amd64 main-mshell.go ``` ```bash # @scripthaus command fullbuild -go build -ldflags="-s -w" -o /Users/mike/.mshell/mshell-v0.2 main-mshell.go -GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/mshell-v0.2-linux.amd64 main-mshell.go -GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o bin/mshell-v0.2-linux.arm64 main-mshell.go -GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o bin/mshell-v0.2-darwin.amd64 main-mshell.go -GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o bin/mshell-v0.2-darwin.arm64 main-mshell.go +GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" +go build -ldflags="$GO_LDFLAGS" -o /Users/mike/.mshell/mshell-v0.2 main-mshell.go +GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.2-linux.amd64 main-mshell.go +GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.2-linux.arm64 main-mshell.go +GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.2-darwin.amd64 main-mshell.go +GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.2-darwin.arm64 main-mshell.go ```