-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
knex cli tool doesn't take --cwd option #326
Comments
This is fixed in #327 but you can solve this problem now by using the |
No, you can't, actually - if you specify a knexfile in a different Thanks for the fix!
|
@tkellen what was the reason again for switching directories here? Was it something that doesn't apply to the way that I'm probably improperly using liftoff here :) |
Liftoff has typically been used to handle configuration files for task runners. In that context, consumers usually want the process to chdir to the directory of the config, that way all file operations are performed relative to it. You might consider removing that from here: ...but don't think I would. @SohumB, what is the use case that drives the need for the process to not chdir? It sounds like you should be invoking migrations programmatically rather than calling out to the CLI. |
The usecase is that we use a different set of config-munging libraries that step in before knex even sees the knexfile, and the path specified is relative to the cwd for them. You're probably right, we probably should be running this programmatically. |
Definitely sounds like a case for using the migration API. |
There's code to read it from
argv.cwd
, but you can't specify it - it goeserror: unknown option --cwd
. We kinda need it, because we don't want the working directory to change when we run knex.The text was updated successfully, but these errors were encountered: