CreateRCFS fixed

This commit is contained in:
mkvolkov 2022-08-21 19:57:24 +03:00
parent 2f72943d83
commit 51ab5597d6
1 changed files with 12 additions and 7 deletions

View File

@ -24,15 +24,20 @@ type RCFS struct {
Cwd string Cwd string
} }
func CreateRCFS(path string) (*RCFS, error) { func CreateRCFS(path, cfg string) (*RCFS, error) {
var cfgpath string
if strings.Compare(cfg, "") == 0 {
u, e := user.Current() u, e := user.Current()
if e != nil { if e != nil {
return nil, e return nil, e
} }
cfgpath = filepath.Join(u.HomeDir, ".config/rclone/rclone.conf")
} else {
cfgpath = cfg
}
cfgpath := filepath.Join(u.HomeDir, ".config/rclone/rclone.conf") e := config.SetConfigPath(cfgpath)
e = config.SetConfigPath(cfgpath)
if e != nil { if e != nil {
return nil, e return nil, e
} }