Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape command-line arguments. #922

Closed
wants to merge 1 commit into from
Closed

Conversation

marcenuc
Copy link

@marcenuc marcenuc commented Jan 9, 2015

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.

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 pushed a commit to flyway/flywaydb.org that referenced this pull request Jan 10, 2015
@axelfontaine
Copy link
Contributor

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
Axel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants