Show a warning when using wrong executable

This commit updates the 'wdcli' command to show a warning when using the
wrong executable.
This commit is contained in:
Tom Wiesing 2022-09-09 13:35:02 +02:00
parent c4de1f2a06
commit 35bb95c5ca
No known key found for this signature in database
29 changed files with 176 additions and 30 deletions

View file

@ -12,7 +12,7 @@ var ErrCopySameFile = errors.New("src and dst must be different files")
// CopyFile copies a file from src to dst.
// When dst and src are the same file, returns ErrCopySameFile.
func CopyFile(dst, src string) error {
if src == dst {
if SameFile(src, dst) {
return ErrCopySameFile
}
@ -51,7 +51,7 @@ func CopyDirectory(dst, src string, onCopy func(dst, src string)) error {
// TODO: Allow copying in parallel? Maybe with a mutex?
// sanity checks
if src == dst {
if SameFile(src, dst) {
return ErrCopySameFile
}
if !IsDirectory(dst) {