Skip to content

Commit 1ad20a7

Browse files
committed
build: skip directories without package.json files
1 parent e3efb84 commit 1ad20a7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/scripts/lint_package_json_files

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ echo "Checking package.json files in directories: ${dirs}"
5959
needs_changes=0
6060
for dir in ${dirs}; do
6161
echo "Checking package.json in ${dir}..."
62-
original_content=$(cat "${dir}/package.json")
62+
package_json="${dir}/package.json"
63+
if [ ! -f "${package_json}" ]; then
64+
continue
65+
fi
66+
original_content=$(cat "${package_json}")
6367

6468
"${update_package_json_directories}" "${dir}"
6569
"${update_package_json_gypfile}" "${dir}"
6670

67-
new_content=$(cat "${dir}/package.json")
71+
new_content=$(cat "${package_json}")
6872
if [ "$original_content" != "$new_content" ]; then
6973
echo "ERROR: package.json in ${dir} needs updates to directories and/or gypfile fields"
70-
git --no-pager diff "${dir}/package.json"
74+
git --no-pager diff "${package_json}"
7175
needs_changes=1
7276
fi
7377
done

0 commit comments

Comments
 (0)