tests: add lint for non portable cp -a
cp -a, while a common flag isn't in POSIX and will therefore fail on systems that don't have GNUish tools (like OpenBSD, AIX or Solaris) Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Carlo Marcelo Arenas Belón committed
Dec 1, 2018 at 09:36 UTC
82cbc8cde25859027aa013568a7040b5a63707d2
1 file changed
+1
t/check-non-portable-shell.pl
+1
@@ -35,6 +35,7 @@ while (<>) {
35
chomp;
36
}
37
38
+ /\bcp\s+-a/ and err 'cp -a is not portable';
39
/\bsed\s+-i/ and err 'sed -i is not portable';
40
/\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)';
41
/^\s*declare\s+/ and err 'arrays/declare not portable';