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

Issue with Windows #15

Open
twrighths opened this issue Oct 24, 2019 · 2 comments
Open

Issue with Windows #15

twrighths opened this issue Oct 24, 2019 · 2 comments

Comments

@twrighths
Copy link

Just came across an issue with how NPM runs in Windows and a way to work around it. Normally, if you install this via npm, it will create what are essentially wrappers to the commands you really want to call. In this case, we want to run flyway.cmd, but due to how npm pulls in the package, the node_modules/.bin folder gets 3 flyway executables [flyway, flyway.cmd, flyway.cmd.cmd]. Because of this, on windows, if you want to make use of this in your package.json scripts section, you have to use the .cmd.cmd script:

"scripts": {
  "migrate": "flyway.cmd.cmd -X -configFile=conf/flyway.conf migrate"
}

"scripts": {
  "migrate": "flyway.cmd.cmd -X -user=postgres -schemas=public,another migrate"
}
@sksethi25
Copy link

@sgraham785 any update on this?

@aldenquimby
Copy link
Collaborator

@twrighths @sksethi25 I'd be glad to try fixing this on my fork: https://github.com/aldenquimby/flywaydb-cli

But I haven't used Windows in a long time. Do you know how the package.json is supposed to be configured here? I imagine if we remove this line:

"flyway.cmd": "./bin/flyway.cmd"

Then on Windows flyway.cmd will end up pointing incorrectly to the unix executable 🤔

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

No branches or pull requests

3 participants