improve conflict error messages, add -v to usage
This commit is contained in:
@@ -56,6 +56,7 @@ func usage() {
|
|||||||
fmt.Println(" sigil unlink <package> [--dry-run]")
|
fmt.Println(" sigil unlink <package> [--dry-run]")
|
||||||
fmt.Println(" sigil remove <package> [--dry-run]")
|
fmt.Println(" sigil remove <package> [--dry-run]")
|
||||||
fmt.Println(" sigil status")
|
fmt.Println(" sigil status")
|
||||||
|
fmt.Println(" sigil -v, --version")
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyCmd(args []string) error {
|
func applyCmd(args []string) error {
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ func linkFile(src, dst string) error {
|
|||||||
if current == src {
|
if current == src {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return fmt.Errorf("conflict at %s (points to %s)", dst, current)
|
return fmt.Errorf("conflict at %s (symlink points to %s, expected %s). Run 'sigil unlink %s' to restore and remove the conflicting link", dst, current, src, dst)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("conflict at %s (exists and is not a symlink)", dst)
|
return fmt.Errorf("conflict at %s (file exists and is not a symlink). Back up or remove this file first", dst)
|
||||||
} else if !errors.Is(err, os.ErrNotExist) {
|
} else if !errors.Is(err, os.ErrNotExist) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user