Skip to content

Commit

Permalink
feat : coding#42 check package name should not have version
Browse files Browse the repository at this point in the history
  • Loading branch information
Hot-Rain1 committed Sep 12, 2021
1 parent a401fcc commit 9e33012
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ if [ -n "$index_file" ]; then
diff index-body.md index-body-sorted.md
fi

package_name=$(awk '{print $1}' /tmp/index-body.md)
echo "check if package name have version number"
for i in $package_name; do
expr "$i" : ".*\.[0-9]\+\." > /dev/null && echo "[ERROR] $i : package name should not have version!" && exit 2
done
if [ -n "$index_file" ]; then
package_name=$(awk '{print $1}' /tmp/index-body.md)
echo "check if package name have version number"
for i in $package_name; do
expr "$i" : ".*\.[0-9]\+\." > /dev/null && echo "[ERROR] $i : package name should not have version!" && exit 2
done
fi

## lint markdown
# TODO

0 comments on commit 9e33012

Please sign in to comment.