Skip to content

Commit 82cbc8c

Browse files
carenasgitster
authored andcommitted
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>
1 parent 8a0ba68 commit 82cbc8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/check-non-portable-shell.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ sub err {
3535
chomp;
3636
}
3737

38+
/\bcp\s+-a/ and err 'cp -a is not portable';
3839
/\bsed\s+-i/ and err 'sed -i is not portable';
3940
/\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)';
4041
/^\s*declare\s+/ and err 'arrays/declare not portable';

0 commit comments

Comments
 (0)