Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Normalize relativePath projects to support Windows path.
[src/xds/xds-server.git]
/
lib
/
model
/
folder.go
diff --git
a/lib/model/folder.go
b/lib/model/folder.go
index
6687b68
..
e461f9c
100644
(file)
--- a/
lib/model/folder.go
+++ b/
lib/model/folder.go
@@
-3,6
+3,7
@@
package model
import (
"fmt"
import (
"fmt"
+ "github.com/iotbzh/xds-server/lib/common"
"github.com/iotbzh/xds-server/lib/syncthing"
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
"github.com/iotbzh/xds-server/lib/syncthing"
"github.com/iotbzh/xds-server/lib/xdsconfig"
)
@@
-69,15
+70,15
@@
func (c *Folder) UpdateFolder(newFolder xdsconfig.FolderConfig) (xdsconfig.Folde
return xdsconfig.FolderConfig{}, err
}
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})
c.Conf.Folders = c.Conf.Folders.Update(xdsconfig.FoldersConfig{newFolder})
- err := c.SThg.FolderChange(st.FolderChangeArg{
- ID: newFolder.ID,
- Label: newFolder.Label,
- RelativePath: newFolder.RelativePath,
- SyncThingID: newFolder.SyncThingID,
- ShareRootDir: c.Conf.ShareRootDir,
- })
+ // Update Syncthing folder
+ err := c.SThg.FolderChange(newFolder)
+
newFolder.BuilderSThgID = c.Conf.Builder.SyncThingID // FIXME - should be removed after local ST config rework
newFolder.Status = xdsconfig.FolderStatusEnable
newFolder.BuilderSThgID = c.Conf.Builder.SyncThingID // FIXME - should be removed after local ST config rework
newFolder.Status = xdsconfig.FolderStatusEnable