Suppressed -/> output unless link is successfully removed

This commit is contained in:
Stanley Shyiko
2017-11-18 15:02:28 -08:00
parent d49b443340
commit 7b60f13fc8
+5 -2
View File
@@ -49,8 +49,11 @@ func LinkLatest() error {
target := GetLink(sourceVersion)
_, err := LsBestMatchWithVersionSlice(vs, sourceVersion)
if err != nil {
log.Info(sourceVersion + " -/> " + target)
if err := os.Remove(filepath.Join(cfg.Dir(), "jdk", sourceVersion)); !os.IsNotExist(err) {
err := os.Remove(filepath.Join(cfg.Dir(), "jdk", sourceVersion))
if err == nil {
log.Info(sourceVersion + " -/> " + target)
}
if !os.IsNotExist(err) {
return err
}
} else {