Fix vendor validation
Previously adding files to vendor/ without adding to vendor.conf would not fail the
validation.
Also be consistent with indentation and use tabs.
@@ -9,9 +9,13 @@ validate_vendor_diff(){
unset IFS
if [ ${#files[@]} -gt 0 ]; then
- # We run vndr to and see if we have a diff afterwards
+ # Remove vendor/ first so that anything not included in vendor.conf will
+ # cause the validation to fail. archive/tar is a special case, see vendor.conf
+ # for details.
+ ls -d vendor/* | grep -v vendor/archive | xargs rm -rf
+ # run vndr to recreate vendor/
vndr
- # Let see if the working directory is clean
+ # check if any files have changed
diffs="$(git status --porcelain -- vendor 2>/dev/null)"
if [ "$diffs" ]; then
{
