blob: 8739a8b0190c33a0b3f527af5624727ade9d1dfd [file] [log] [blame]
Martin Rothadcba942016-11-28 13:16:24 -07001#!/bin/sh
Martin Rothadcba942016-11-28 13:16:24 -07002#
Patrick Georgi7333a112020-05-08 20:48:04 +02003# SPDX-License-Identifier: GPL-2.0-only
4
Martin Rothadcba942016-11-28 13:16:24 -07005# DESCR: Report any symbolic links
6
7LC_ALL=C export LC_ALL
8
9EXCLUDED_DIRS='^3rdparty\|^site-local'
10
11# If the code is in a git repo, only print files that are checked in
Alex Thiessen73f19dc2018-01-16 23:05:48 +000012if [ -n "$(command -v git)" ] && \
13 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
14then
Martin Rothadcba942016-11-28 13:16:24 -070015 git ls-tree -r HEAD | \
16 grep ^120000 | \
17 cut -f2 | \
18 grep -v "$EXCLUDED_DIRS"
19else
20 # If the code isn't in a git repo, print everything
21 find . -type l | \
22 sed 's|\.\/||' | \
23 grep -v "$EXCLUDED_DIRS"
24fi