Skip to content

Commit f17e9fb

Browse files
committed
test-lib: Work around incompatible sort and find on Windows
If the PATH lists the Windows system directories before the MSYS directories, Windows's own incompatible sort and find commands would be picked up. We implement these commands as functions and call the real tools by absolute path. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
1 parent a8cbc9a commit f17e9fb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/test-lib.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,3 +635,16 @@ do
635635
test_done
636636
esac
637637
done
638+
639+
# Fix some commands on Windows
640+
case $(uname -s) in
641+
*MINGW*)
642+
# Windows has its own (incompatible) sort and find
643+
sort () {
644+
/usr/bin/sort "$@"
645+
}
646+
find () {
647+
/usr/bin/find "$@"
648+
}
649+
;;
650+
esac

0 commit comments

Comments
 (0)