Skip to content

Commit

Permalink
tools: spdx-check file parameter
Browse files Browse the repository at this point in the history
also allow to use this tool directly with a path
as a parameter

Signed-off-by: Christoph Ostarek <[email protected]>
  • Loading branch information
christoph-zededa committed Sep 9, 2024
1 parent edd5d92 commit f53b148
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tools/spdx-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
# Copyright (c) 2024 Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0

BASE_COMMIT=$1
IGNORE_FILE=".spdxignore"
if [ -f "$1" ];
then
files="$1"
else
BASE_COMMIT=$1

# List of files to check, excluding vendor directories
files=$(git diff --name-only --diff-filter=A "${BASE_COMMIT}"..HEAD)
fi

# List of files to check, excluding vendor directories
files=$(git diff --name-only --diff-filter=A "${BASE_COMMIT}"..HEAD)

# SPDX License Identifier to check for
license_identifiers=(
Expand Down

0 comments on commit f53b148

Please sign in to comment.