diff --git a/bin/refresh-wp-install-tests.sh b/bin/refresh-wp-install-tests.sh index eb7266c..c97a9f0 100755 --- a/bin/refresh-wp-install-tests.sh +++ b/bin/refresh-wp-install-tests.sh @@ -2,10 +2,13 @@ # # Refreshes the bin/install-wp-tests.sh file from source, injecting a comment at the top of the file. -SRC="https://raw.githubusercontent.com/wp-cli/scaffold-command/master/templates/install-wp-tests.sh" -DIR="$( cd "$(dirname "$0")" || exit 1; pwd -P )" +upstream_src='https://raw.githubusercontent.com/wp-cli/scaffold-command/master/templates/install-wp-tests.sh' +bin_dir="$(dirname "${BASH_SOURCE[0]}")" -curl -s "$SRC" \ - | sed $'2i\\\n# Notice: This file is pulled from the WP-CLI scaffold command,\\\n# and should not be modified directly.\n' \ - > "$DIR/install-wp-tests.sh" \ - && echo -e "\033[0;32mbin/install-wp-tests.sh has been updated to match ${SRC}\033[0;0m" +curl -s "$upstream_src" | sed "2i\\ +# Notice: This file is pulled from the WP-CLI scaffold command, and should not be modified directly.\\ +#\\ +# ${upstream_src} +" > "${bin_dir}/install-wp-tests.sh" || exit 1 + +printf "\033[0;32m%s %s\033[0;32m\n" 'bin/install-wp-tests.sh has been updated to match' "$upstream_src"