summaryrefslogtreecommitdiffstats
path: root/lib/model
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 23:18:04 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-18 23:19:43 +0200
commit387641b4352d9f9da0d036db68a79e1fadbd4b5d (patch)
tree9965511bf2e3820b2114504aab25ef9cffb2e4f7 /lib/model
parenta52a4ddc7662b8a4d0b8a1fd7be88742d1379691 (diff)
Normalize relativePath projects to support Windows path.
Diffstat (limited to 'lib/model')
-rw-r--r--lib/model/folder.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/model/folder.go b/lib/model/folder.go
index be1bc33..e461f9c 100644
--- a/lib/model/folder.go
+++ b/lib/model/folder.go
@@ -3,6 +3,7 @@ package model
import (
"fmt"
+ "github.com/iotbzh/xds-server/lib/common"
"github.com/iotbzh/xds-server/lib/syncthing"
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
@@ -69,8 +70,13 @@ func (c *Folder) UpdateFolder(newFolder xdsconfig.FolderConfig) (xdsconfig.Folde
return xdsconfig.FolderConfig{}, err
}
+ // Normalize path (needed for Windows path including bashlashes)
+ newFolder.RelativePath = common.PathNormalize(newFolder.RelativePath)
+
+ // Update config folder
c.Conf.Folders = c.Conf.Folders.Update(xdsconfig.FoldersConfig{newFolder})
+ // Update Syncthing folder
err := c.SThg.FolderChange(newFolder)
newFolder.BuilderSThgID = c.Conf.Builder.SyncThingID // FIXME - should be removed after local ST config rework