lib/versioner: Fix external versioner command specification on Windows (fixes #4560)
This commit is contained in:
committed by
Audrius Butkevicius
parent
3f4f6d5787
commit
bc7639b0ff
@@ -10,6 +10,7 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/fs"
|
||||
@@ -30,6 +31,10 @@ type External struct {
|
||||
func NewExternal(folderID string, filesystem fs.Filesystem, params map[string]string) Versioner {
|
||||
command := params["command"]
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
command = strings.Replace(command, `\`, `\\`, -1)
|
||||
}
|
||||
|
||||
s := External{
|
||||
command: command,
|
||||
filesystem: filesystem,
|
||||
|
||||
Reference in New Issue
Block a user