Skip to content

Commit

Permalink
Merge pull request #487 from AlbericC/feat/fix486
Browse files Browse the repository at this point in the history
fix #486 - config.StoreSir path escaping on `server run` for windows OS
  • Loading branch information
ripienaar authored Jun 3, 2022
2 parents 1b0bab9 + b17dbfc commit d87e684
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cli/server_run_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os/signal"
"os/user"
"path/filepath"
"runtime"
"strings"
"syscall"
"text/template"
Expand Down Expand Up @@ -215,6 +216,10 @@ 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)
}
Expand Down

0 comments on commit d87e684

Please sign in to comment.