From ea3e377f6c09a9e367f549699d6261cb0aa42a01 Mon Sep 17 00:00:00 2001 From: sawka Date: Thu, 23 Feb 2023 15:19:01 -0800 Subject: [PATCH] updates for client version --- scripthaus.md | 13 +++++++------ src/model.ts | 6 ++++++ src/types.ts | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripthaus.md b/scripthaus.md index a17ad1efe..08c565c12 100644 --- a/scripthaus.md +++ b/scripthaus.md @@ -57,12 +57,13 @@ rm -rf bin/ rm -rf build/ node_modules/.bin/webpack --config webpack.prod.js node_modules/.bin/webpack --config webpack.electron.prod.js -(cd ../mshell; GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ../sh2/bin/mshell/mshell-v0.2-darwin.amd64 main-mshell.go) -(cd ../mshell; GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ../sh2/bin/mshell/mshell-v0.2-darwin.arm64 main-mshell.go) -(cd ../mshell; GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ../sh2/bin/mshell/mshell-v0.2-linux.amd64 main-mshell.go) -(cd ../mshell; GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o ../sh2/bin/mshell/mshell-v0.2-linux.arm64 main-mshell.go) -(cd ../sh2-server; GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ../sh2/build/prompt-local-server.amd64 cmd/main-server.go) -(cd ../sh2-server; GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ../sh2/build/prompt-local-server.arm64 cmd/main-server.go) +GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')" +(cd ../mshell; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/bin/mshell/mshell-v0.2-darwin.amd64 main-mshell.go) +(cd ../mshell; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/bin/mshell/mshell-v0.2-darwin.arm64 main-mshell.go) +(cd ../mshell; GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/bin/mshell/mshell-v0.2-linux.amd64 main-mshell.go) +(cd ../mshell; GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/bin/mshell/mshell-v0.2-linux.arm64 main-mshell.go) +(cd ../sh2-server; GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/build/prompt-local-server.amd64 ./cmd) +(cd ../sh2-server; GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../sh2/build/prompt-local-server.arm64 ./cmd) lipo -create -output bin/prompt-local-server build/prompt-local-server.amd64 build/prompt-local-server.arm64 node_modules/.bin/electron-forge make ``` diff --git a/src/model.ts b/src/model.ts index 302b3553e..455b49ed2 100644 --- a/src/model.ts +++ b/src/model.ts @@ -21,6 +21,11 @@ const ProdServerWsEndpoint = "ws://localhost:1623"; const DevServerEndpoint = "http://localhost:8090"; const DevServerWsEndpoint = "ws://localhost:8091"; +// @ts-ignore +const VERSION = __PROMPT_VERSION__; +// @ts-ignore +const BUILD = __PROMPT_BUILD__; + type SWLinePtr = { line : LineType, @@ -1946,6 +1951,7 @@ class Model { remote : null, winsize: null, linenum: null, + build: VERSION + " " + BUILD, }; let session = this.getActiveSession(); if (session != null) { diff --git a/src/types.ts b/src/types.ts index 68b3d16b5..9d43f3008 100644 --- a/src/types.ts +++ b/src/types.ts @@ -181,6 +181,7 @@ type UIContextType = { remote : RemotePtrType, winsize : TermWinSize, linenum : number, + build : string, }; type FeCmdPacketType = {