Escape command-line arguments. #922
Closed
Conversation
Following the instructions at http://flywaydb.org/documentation/existing.html on Linux, the following command fails with `ERROR: Invalid operation: version`: ./flyway baseline -Dflyway.baselineVersion=1 \ -Dflyway.baselineDescription="Base version" The problem is that the `flyway` Bash script does not properly escape the command line arguments. This patch adds quotes around all variables to fix this error. As a side effect, it also allows to have spaces in the Flyway installation directory name.
axelfontaine
added a commit
to flyway/flywaydb.org
that referenced
this pull request
Jan 10, 2015
Thanks. Flyway already works when installed in directories with spaces (we explicitly test for that). However, nice catch with the arguments! I haven't merged the PR as it contained unnecessary changes, but I added the quoting around the one argument. Cheers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Following the instructions at
http://flywaydb.org/documentation/existing.html on Linux, the following
command fails with
ERROR: Invalid operation: version
:The problem is that the
flyway
Bash script does not properly escapethe command line arguments.
This patch adds quotes around all variables to fix this error. As a
side effect, it also allows to have spaces in the Flyway installation
directory name.