Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 1 | #!/bin/sh |
Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 5 | # DESCR: Report any symbolic links |
| 6 | |
| 7 | LC_ALL=C export LC_ALL |
| 8 | |
| 9 | EXCLUDED_DIRS='^3rdparty\|^site-local' |
| 10 | |
| 11 | # If the code is in a git repo, only print files that are checked in |
Alex Thiessen | 73f19dc | 2018-01-16 23:05:48 +0000 | [diff] [blame] | 12 | if [ -n "$(command -v git)" ] && \ |
| 13 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 14 | then |
Martin Roth | adcba94 | 2016-11-28 13:16:24 -0700 | [diff] [blame] | 15 | git ls-tree -r HEAD | \ |
| 16 | grep ^120000 | \ |
| 17 | cut -f2 | \ |
| 18 | grep -v "$EXCLUDED_DIRS" |
| 19 | else |
| 20 | # If the code isn't in a git repo, print everything |
| 21 | find . -type l | \ |
| 22 | sed 's|\.\/||' | \ |
| 23 | grep -v "$EXCLUDED_DIRS" |
| 24 | fi |