From 6c7e4b4e3f63dc95ed2c9306ff6c9cdf854e1d91 Mon Sep 17 00:00:00 2001 From: Peter Magnusson Date: Fri, 17 Mar 2023 14:08:44 +0100 Subject: [PATCH] quote StoreDir and reuse new escape filter --- cli/server_run_command.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cli/server_run_command.go b/cli/server_run_command.go index 9563290f..ec41f3c8 100644 --- a/cli/server_run_command.go +++ b/cli/server_run_command.go @@ -55,7 +55,7 @@ logtime: false {{- if .JetStream }} jetstream { - store_dir: {{ .StoreDir }} + store_dir: "{{ .StoreDir | escape }}" {{- if .JSDomain }} domain: {{ .JSDomain }} {{- end }} @@ -258,10 +258,7 @@ func (c *SrvRunCmd) prepareConfig() error { return err } c.config.StoreDir = filepath.Join(parent, "nats", c.config.Name) - if runtime.GOOS == "windows" { - // escape path separator in file - c.config.StoreDir = strings.ReplaceAll(c.config.StoreDir, "\\", "\\\\") - } + if c.config.ExtendWithContext || c.config.ExtendDemoNetwork { c.config.JSDomain = strings.ToUpper(c.config.Name) }