diff --git a/Makefile b/Makefile index 8a1cd590342..ec5c1bdccba 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/scripts/check_file_name_spaces.sh b/scripts/check_file_name_spaces.sh new file mode 100755 index 00000000000..280adc525d2 --- /dev/null +++ b/scripts/check_file_name_spaces.sh @@ -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 \ No newline at end of file