diff --git a/README.md b/README.md index 74c3b187..6f68adf8 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,20 @@ For example, to disable search attribute cache to make created search attributes temporalite start --dynamic-config-value system.forceSearchAttributesCacheRefreshOnRead=true ``` +## Development + +To compile the source run: + +```bash +go build -o dist/temporalite ./cmd/temporalite +``` + +To run all tests: + +```bash +go test ./... +``` + ## Known Issues - When consuming Temporalite as a library in go mod, you may want to replace grpc-gateway with a fork to address URL escaping issue in UI. See diff --git a/cmd/temporalite/main.go b/cmd/temporalite/main.go index 72320a8c..eccecccc 100644 --- a/cmd/temporalite/main.go +++ b/cmd/temporalite/main.go @@ -10,6 +10,7 @@ import ( goLog "log" "net" "os" + "path/filepath" "strings" "github.com/urfave/cli/v2" @@ -162,6 +163,11 @@ func buildCLI() *cli.App { return cli.Exit(fmt.Sprintf("ERROR: only one of %q or %q flags may be passed at a time", ephemeralFlag, dbPathFlag), 1) } + err := os.MkdirAll(filepath.Dir(c.String(dbPathFlag)), os.ModePerm) + if err != nil { + return cli.Exit(err.Error(), 1) + } + switch c.String(logFormatFlag) { case "json", "pretty": default: