libf 4 kuukautta sitten
vanhempi
commit
92135faf9f
3 muutettua tiedostoa jossa 10 lisäystä ja 4 poistoa
  1. 1 1
      go.mod
  2. 2 2
      go.sum
  3. 7 1
      sync/sync.go

+ 1 - 1
go.mod

@@ -43,7 +43,7 @@ require (
 )
 
 require (
-	git.wecise.com/wecise/util v0.0.0-20241216141312-1587ceee6f6e
+	git.wecise.com/wecise/util v0.0.0-20250105111858-e3945cf17779
 	github.com/chromedp/cdproto v0.0.0-20240214232516-ad4608604e9e
 	github.com/chromedp/chromedp v0.9.5
 	github.com/fatih/color v1.18.0 // indirect

+ 2 - 2
go.sum

@@ -1,5 +1,5 @@
-git.wecise.com/wecise/util v0.0.0-20241216141312-1587ceee6f6e h1:x1WYYej8y2jc0hffLmC85Le4IHjJO6awdlSJtvZywGo=
-git.wecise.com/wecise/util v0.0.0-20241216141312-1587ceee6f6e/go.mod h1:2YXWE9m5mNgAu40zpYrL3woGz6S8CoHAW/CJeWXaIko=
+git.wecise.com/wecise/util v0.0.0-20250105111858-e3945cf17779 h1:lUEkDcO4yvMQbIhEoIhw+6TaUF0DTl1T2XTZXQ8oQAE=
+git.wecise.com/wecise/util v0.0.0-20250105111858-e3945cf17779/go.mod h1:2YXWE9m5mNgAu40zpYrL3woGz6S8CoHAW/CJeWXaIko=
 github.com/atrox/homedir v1.0.0 h1:99Vwk+XECZTDLaAPeMj7vF9JMNcVarWddqPeyDzJT5E=
 github.com/atrox/homedir v1.0.0/go.mod h1:ZKVEIDNKscX8qV1TyrwLP+ayjv3XQO7wbVmc5EW00A8=
 github.com/chromedp/cdproto v0.0.0-20240202021202-6d0b6a386732/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=

+ 7 - 1
sync/sync.go

@@ -289,7 +289,13 @@ func WriteRemoteFile(username, password, hostport, remotepath, fpath string, bs
 	if e != nil {
 		return e
 	}
-	e = client.WriteFile(remotepath+"/"+fpath, bs, os.ModePerm, mtime)
+	rfpath := remotepath + "/" + fpath
+	diridx := strings.LastIndex(rfpath, "/")
+	e = client.MkdirAll(rfpath[:diridx])
+	if e != nil {
+		return e
+	}
+	e = client.WriteFile(rfpath, bs, os.ModePerm, mtime)
 	if e != nil {
 		return e
 	}