Skip to content

Commit

Permalink
chore: allow passing custom targets for COPYRIGHT script
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
  • Loading branch information
Tomas2D committed Dec 13, 2024
1 parent 972681f commit ca17a18
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/copyright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

set -e

TARGETS=(${TARGETS:-src dist tests scripts})

# Path to the package.json file
PACKAGE_JSON_PATH="./package.json"

Expand Down Expand Up @@ -42,9 +44,9 @@ if ! command -v nwa &> /dev/null && command -v go &> /dev/null; then
fi

if command -v nwa &> /dev/null; then
nwa add -l apache -c "$AUTHOR" src dist tests scripts
nwa add -l apache -c "$AUTHOR" "${TARGETS[@]}"
elif command -v docker &> /dev/null; then
docker run --rm -v "${PWD}:/src" ghcr.io/b1nary-gr0up/nwa:main add -l apache -c "$AUTHOR" src dist tests scripts
docker run --rm -v "${PWD}:/src" ghcr.io/b1nary-gr0up/nwa:main add -l apache -c "$AUTHOR" "${TARGETS[@]}"
else
echo "Error: 'nwa' is not available. Either install it manually or install go/docker."
exit 1
Expand Down

0 comments on commit ca17a18

Please sign in to comment.