From 9037a05041ec080b9541e846af84241513e37aae Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 19 Mar 2018 17:00:44 -0700 Subject: [PATCH] msvs build: only fix_file_list when it is broken Clears a warning when generating VS project files with older versions of bash: declare: -n: invalid option Change-Id: Id0c0bc17dc5a1599f7d2d73e3cc9259a45540f3f --- build/make/msvs_common.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/make/msvs_common.sh b/build/make/msvs_common.sh index 88f1cf9b5..27ddf7fd9 100644 --- a/build/make/msvs_common.sh +++ b/build/make/msvs_common.sh @@ -41,6 +41,15 @@ fix_path() { # Corrects the paths in file_list in one pass for efficiency. # $1 is the name of the array to be modified. fix_file_list() { + if [ "${FIXPATH}" = "echo_path" ] ; then + # When used with echo_path, fix_file_list is a no-op. Avoid warning about + # unsupported 'declare -n' when it is not important. + return 0 + elif [ "${BASH_VERSINFO}" -lt 4 ] ; then + echo "Cygwin path conversion has failed. Please use a version of bash" + echo "which supports nameref (-n), introduced in bash 4.3" + return 1 + fi declare -n array_ref=$1 files=$(fix_path "${array_ref[@]}") local IFS=$'\n' -- 2.40.0