make binary paths consistent between dev/prod. add 'eval' as a rtnstate command. fix waveterm.lock file

This commit is contained in:
sawka 2023-11-09 16:08:32 -08:00
parent 876321d06d
commit 68731f45a2
6 changed files with 8 additions and 48 deletions

View File

@ -77,14 +77,14 @@ open out/Wave-darwin-x64/Wave.app
```bash
# @scripthaus command build-wavesrv
cd wavesrv
CGO_ENABLED=1 go build -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o bin/wavesrv ./cmd
CGO_ENABLED=1 go build -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o ../bin/wavesrv ./cmd
```
```bash
# @scripthaus command build-waveshell
cd waveshell
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.amd64 main-waveshell.go
go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell-v0.3-darwin.amd64 main-waveshell.go
```
```bash
@ -93,10 +93,10 @@ set -e
cd waveshell
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o ~/.mshell/mshell-v0.2 main-waveshell.go
GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-linux.amd64 main-waveshell.go
GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-linux.arm64 main-waveshell.go
GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.amd64 main-waveshell.go
GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.arm64 main-waveshell.go
GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.amd64 main-waveshell.go
GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-linux.arm64 main-waveshell.go
GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.amd64 main-waveshell.go
GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o ../bin/mshell/mshell-v0.3-darwin.arm64 main-waveshell.go
```
```bash

View File

@ -133,9 +133,6 @@ function getBaseHostPort() {
}
function getWaveSrvPath() {
if (isDev) {
return path.join(getAppBasePath(), "wavesrv", "bin", "wavesrv");
}
return path.join(getAppBasePath(), "bin", "wavesrv");
}

View File

@ -1,18 +0,0 @@
```bash
# @scripthaus command build
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.amd64 main-waveshell.go
```
```bash
# @scripthaus command fullbuild
GO_LDFLAGS="-s -w -X main.BuildTime=$(date +'%Y%m%d%H%M')"
go build -ldflags="$GO_LDFLAGS" -o ~/.mshell/mshell-v0.2 main-waveshell.go
GOOS=linux GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-linux.amd64 main-waveshell.go
GOOS=linux GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-linux.arm64 main-waveshell.go
GOOS=darwin GOARCH=amd64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.amd64 main-waveshell.go
GOOS=darwin GOARCH=arm64 go build -ldflags="$GO_LDFLAGS" -o bin/mshell-v0.3-darwin.arm64 main-waveshell.go
```

View File

@ -179,7 +179,7 @@ func setBracketArgs(argMap map[string]string, bracketStr string) error {
return nil
}
var literalRtnStateCommands = []string{".", "source", "unset", "cd", "alias", "unalias", "deactivate"}
var literalRtnStateCommands = []string{".", "source", "unset", "cd", "alias", "unalias", "deactivate", "eval"}
func getCallExprLitArg(callExpr *syntax.CallExpr, argNum int) string {
if len(callExpr.Args) <= argNum {

View File

@ -75,9 +75,6 @@ func MShellBinaryDir() string {
if appPath == "" {
appPath = "."
}
if IsDevMode() {
return path.Join(appPath, "waveshell", "bin")
}
return path.Join(appPath, "bin", "mshell")
}
@ -159,7 +156,7 @@ func AcquireWaveLock() (*os.File, error) {
return nil, fmt.Errorf("cannot find/create WAVETERM_HOME directory %q", homeDir)
}
lockFileName := path.Join(homeDir, WaveLockFile)
fd, err := os.Create(lockFileName)
fd, err := os.OpenFile(lockFileName, os.O_WRONLY|os.O_CREATE, 0600)
if err != nil {
return nil, err
}

View File

@ -1,16 +0,0 @@
# SH2 Server Commands
```bash
# @scripthaus command dump-schema-dev
sqlite3 ~/.waveterm-dev/waveterm.db .schema > db/schema.sql
```
```bash
# @scripthaus command opendb-dev
sqlite3 ~/.waveterm-dev/waveterm.db
```
```bash
# @scripthaus command build
go build -ldflags "-X main.BuildTime=$(date +'%Y%m%d%H%M')" -o bin/wavesrv ./cmd
```