mirror of https://github.com/docker/cli.git
update comments
Signed-off-by: Will Wang <willww64@gmail.com>
This commit is contained in:
parent
a85a37e3f3
commit
01182919b3
|
@ -167,12 +167,12 @@ func (configFile *ConfigFile) Save() (retErr error) {
|
|||
return errors.Wrap(err, "error closing temp file")
|
||||
}
|
||||
|
||||
// Handle situations where `configFile.Filename` is a symlink, and allow for dangling symlinks
|
||||
// Handle situation where the configfile is a symlink, and allow for dangling symlinks
|
||||
cfgFile := configFile.Filename
|
||||
if f, err := filepath.EvalSymlinks(cfgFile); err == nil {
|
||||
cfgFile = f
|
||||
} else if os.IsNotExist(err) {
|
||||
// extract the path from the error if `cfgFile` does not exist or is a dangling symlink
|
||||
// extract the path from the error if the configfile does not exist or is a dangling symlink
|
||||
cfgFile = err.(*os.PathError).Path
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue