Skip to content

Commit

Permalink
build: directly compare file contents before and after
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Dec 7, 2024
1 parent ff80d7d commit abb1bd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/scripts/lint_package_json_files
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ echo "Checking package.json files in directories: ${dirs}"
needs_changes=0
for dir in ${dirs}; do
echo "Checking package.json in ${dir}..."
original_content=$(cat "${dir}/package.json")

"${update_package_json_directories}" "${dir}"
"${update_package_json_gypfile}" "${dir}"
if ! git diff-index --quiet HEAD -- "${dir}/package.json"; then

new_content=$(cat "${dir}/package.json")
if [ "$original_content" != "$new_content" ]; then
echo "ERROR: package.json in ${dir} needs updates to directories and/or gypfile fields"
git --no-pager diff "${dir}/package.json"
needs_changes=1
Expand Down

0 comments on commit abb1bd0

Please sign in to comment.