Skip to content

Commit

Permalink
[FAB-16397] Check file names for spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Tiffany Harris <[email protected]>
Change-Id: I7239299b39236a60da152501b14183b101760eab
  • Loading branch information
stephyee committed Nov 19, 2019
1 parent 048351a commit 9772163
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ all: check-go-version native docker checks
checks: basic-checks unit-test integration-test

.PHONY: basic-checks
basic-checks: check-go-version license spelling references trailing-spaces linter check-metrics-doc
basic-checks: check-go-version license spelling references trailing-spaces linter check-metrics-doc filename-spaces

.PHONY: desk-checks
desk-check: checks verify
Expand Down Expand Up @@ -307,3 +307,7 @@ release-clean: $(RELEASE_PLATFORMS:%=%-release-clean)

.PHONY: unit-test-clean
unit-test-clean:

.PHONY: filename-spaces
spaces:
@scripts/check_file_name_spaces.sh
20 changes: 20 additions & 0 deletions scripts/check_file_name_spaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

set -e

fabric_dir="$(cd "$(dirname "$0")/.." && pwd)"

echo "Checking files for spaces in file names..."

filenames=$(find "$fabric_dir" -name '* *')
if [ -n "$filenames" ]; then
echo "The following file names contain spaces:"
echo "$filenames"
echo "File names must not contain spaces."
exit 1
fi

0 comments on commit 9772163

Please sign in to comment.