summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 22:07:33 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 22:13:09 +0200
commit4feb29ac401c7f8416e55ae51ba16cc6819f6a2c (patch)
treed920182da71477bc4f1a31ffeac03ef9ba20a922
parent8b490b817a83836afd66162e2b507c8d320c73cd (diff)
Delete folders on disk (Server side and for Syncthing folder only)
-rw-r--r--lib/syncthing/folder-st.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/syncthing/folder-st.go b/lib/syncthing/folder-st.go
index a372b6f..7e1fe55 100644
--- a/lib/syncthing/folder-st.go
+++ b/lib/syncthing/folder-st.go
@@ -2,6 +2,7 @@ package st
import (
"fmt"
+ "os"
"path/filepath"
"strings"
@@ -129,7 +130,15 @@ func (f *STFolder) ConvPathSvr2Cli(s string) string {
// Remove a folder
func (f *STFolder) Remove() error {
- return f.st.FolderDelete(f.stfConfig.ID)
+ err := f.st.FolderDelete(f.stfConfig.ID)
+
+ // Delete folder on server side
+ err2 := os.RemoveAll(f.GetFullPath(""))
+
+ if err != nil {
+ return err
+ }
+ return err2
}
// RegisterEventChange requests registration for folder event change