aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2019-11-08 20:47:58 +0100
committerGitHub <noreply@github.com>2019-11-08 20:47:58 +0100
commit9fb278ddea492cdae53be6fd948c75498df2f712 (patch)
tree3161b99275d1933baf41c93755be1b8f32a56e07 /scripts/vim-patch.sh
parent2ba212e8c25794184ce465d468eb62714ea7ba03 (diff)
downloadrneovim-9fb278ddea492cdae53be6fd948c75498df2f712.tar.gz
rneovim-9fb278ddea492cdae53be6fd948c75498df2f712.tar.bz2
rneovim-9fb278ddea492cdae53be6fd948c75498df2f712.zip
vim-patch.sh: multiline printf -> heredoc (#11351)
The following script is cut out from vim-patch.sh: ```sh #!/usr/bin/env bash BASENAME=vim-patch.sh printf "\nInstructions: To port one of the above patches to Neovim, execute this script with the patch revision as argument and follow the instructions, e.g. '%s -p v8.0.1234', or '%s -P v8.0.1234' NOTE: Please port the _oldest_ patch if you possibly can. You can use '%s -l path/to/file' to see what patches are missing for a file. " "${BASENAME}" "${BASENAME}" "${BASENAME}" ``` The code itself should be correct, but shellcheck 0.7.0 says: ``` In /tmp/test.sh line 5: printf "\nInstructions: ^-- SC2183: This format string has 2 variables, but is passed 3 arguments. ``` We also had a problem before that a `%s` was added, but the accompanying argument to printf was forgotten. Using a heredoc is less error-prone, since we insert variables directly.
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index b946266599..b6a0df4649 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -501,13 +501,15 @@ show_vimpatches() {
fi
done
- printf "\nInstructions:
+ cat << EOF
+
+Instructions:
To port one of the above patches to Neovim, execute this script with the patch revision as argument and follow the instructions, e.g.
- '%s -p v8.0.1234', or '%s -P v8.0.1234'
+ '${BASENAME} -p v8.0.1234', or '${BASENAME} -P v8.0.1234'
NOTE: Please port the _oldest_ patch if you possibly can.
- You can use '%s -l path/to/file' to see what patches are missing for a file.
-" "${BASENAME}" "${BASENAME}" "${BASENAME}"
+ You can use '${BASENAME} -l path/to/file' to see what patches are missing for a file.
+EOF
}
review_commit() {