Skip to content

Commit

Permalink
Update native_check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
spacevx committed Mar 7, 2024
1 parent fb27195 commit bb2f06a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .ci/native_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ while IFS= read -r md_file; do
ns=$(grep -Po '^---\nns: \K.*' "$md_file" | head -n 1)

if [[ -z "$ns" ]]; then
echo "Error: 'ns' missing in $md_file"
continue
printf "Error: 'ns' missing in $md_file"
exit 1
fi

# Check if 'ns' exists as a project directory
if [[ ! " ${valid_ns_dirs[*]} " =~ " ${ns} " ]]; then
echo "Error: The namespace '${ns}' specified in ${md_file} does not exist as a directory in the project."
continue
printf "Error: The namespace '${ns}' specified in ${md_file} does not exist as a directory in the project."
exit 1
fi

# Determine the directory name of the current file
folderName=$(basename "$(dirname "$md_file")")

# Check if file is in the correct directory according to its 'ns' value
if [[ "$ns" != "$folderName" ]]; then
echo "Error: The file \`${md_file}\` is located in the '${folderName}' directory but should be in '${ns}'."
continue
printf "Error: The file \`${md_file}\` is located in the '${folderName}' directory but should be in '${ns}'."
exit 1
fi

echo "$md_file successfully verified."
Expand Down

0 comments on commit bb2f06a

Please sign in to comment.