mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
lib/versioner: Fix external versioner command specification on Windows (fixes #4560)
This commit is contained in:
parent
3f4f6d5787
commit
bc7639b0ff
@ -176,7 +176,7 @@
|
|||||||
<p translate class="help-block">Path where versions should be stored (leave empty for the default .stversions directory in the shared folder).</p>
|
<p translate class="help-block">Path where versions should be stored (leave empty for the default .stversions directory in the shared folder).</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='external'" ng-class="{'has-error': folderEditor.externalCommand.$invalid && folderEditor.externalCommand.$dirty}">
|
<div class="form-group" ng-if="currentFolder.fileVersioningSelector=='external'" ng-class="{'has-error': folderEditor.externalCommand.$invalid && folderEditor.externalCommand.$dirty}">
|
||||||
<p translate class="help-block">An external command handles the versioning. It has to remove the file from the shared folder.</p>
|
<p translate class="help-block">An external command handles the versioning. It has to remove the file from the shared folder. If the path to the application contains spaces, it should be quoted.</p>
|
||||||
<label translate for="externalCommand">Command</label>
|
<label translate for="externalCommand">Command</label>
|
||||||
<input name="externalCommand" id="externalCommand" class="form-control" type="text" ng-model="currentFolder.externalCommand" required="" aria-required="true" />
|
<input name="externalCommand" id="externalCommand" class="form-control" type="text" ng-model="currentFolder.externalCommand" required="" aria-required="true" />
|
||||||
<p class="help-block">
|
<p class="help-block">
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/syncthing/syncthing/lib/fs"
|
"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 {
|
func NewExternal(folderID string, filesystem fs.Filesystem, params map[string]string) Versioner {
|
||||||
command := params["command"]
|
command := params["command"]
|
||||||
|
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
command = strings.Replace(command, `\`, `\\`, -1)
|
||||||
|
}
|
||||||
|
|
||||||
s := External{
|
s := External{
|
||||||
command: command,
|
command: command,
|
||||||
filesystem: filesystem,
|
filesystem: filesystem,
|
||||||
|
Loading…
Reference in New Issue
Block a user