fix(config): don't throw error when file not available on OS
This commit is contained in:
parent
d3bab447e0
commit
a0662e9066
|
@ -88,6 +88,10 @@ func getSSHConfig(uriFlag string) (*ssh.ClientConfig, string, string, error) {
|
|||
|
||||
var currentUser *osUser.User
|
||||
currentUser, err = osUser.Current()
|
||||
if err != nil {
|
||||
return nil, "", "", err
|
||||
}
|
||||
|
||||
user = currentUser.Username
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,10 @@ func (e *Items) Action(action string) {
|
|||
PrintError("[%d] failed to resolve item paths \"%v\": %v", i, l, err)
|
||||
continue
|
||||
}
|
||||
if storagePath == "" && systemPath == "" {
|
||||
color.Blue("[%d] file doesn't have configuration path for current OS. Skipping...")
|
||||
continue
|
||||
}
|
||||
|
||||
if action == "save" {
|
||||
src = systemPath
|
||||
|
|
|
@ -97,11 +97,17 @@ func ConfigPaths(os configuration.OSLocation, location string) (string, string,
|
|||
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
if os.Linux == "" {
|
||||
return "", "", nil
|
||||
}
|
||||
src, dst, err = getPaths(os.Linux, location)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
case "darwin":
|
||||
if os.Darwin == "" {
|
||||
return "", "", nil
|
||||
}
|
||||
src, dst, err = getPaths(os.Darwin, location)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
|
|
Reference in New Issue