mirror of https://github.com/spf13/afero.git
CreateRCFS fixed
This commit is contained in:
parent
2f72943d83
commit
51ab5597d6
|
@ -24,15 +24,20 @@ type RCFS struct {
|
|||
Cwd string
|
||||
}
|
||||
|
||||
func CreateRCFS(path string) (*RCFS, error) {
|
||||
u, e := user.Current()
|
||||
if e != nil {
|
||||
return nil, e
|
||||
func CreateRCFS(path, cfg string) (*RCFS, error) {
|
||||
var cfgpath string
|
||||
|
||||
if strings.Compare(cfg, "") == 0 {
|
||||
u, e := user.Current()
|
||||
if e != nil {
|
||||
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 {
|
||||
return nil, e
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue