seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
902 stars 160 forks source link

Issue with -f/--file option: CLI looks for migration directory path in current directory instead of configuration relative #438

Open SylvanasCry opened 11 months ago

SylvanasCry commented 11 months ago

Summary

The -f, --file option in the CLI program allows users to specify the path to the program's configuration file. Inside this configuration file, the path to the directory containing migrations is indicated. However, a bug has been discovered that leads to incorrect behavior of the program.

Steps to Reproduce

Run the CLI program using the -f, --file option and specify the path to the configuration file.

migrate-mongo status -f ./path/to/migrate-mongo-config.js

Actual Behavior

After specifying the -f, --file option, the program uses pwd as base path for migration directory.

Expected Behavior

After specifying the -f, --file option, the program should use the path to the migration directory specified inside the configuration file and based on its (configuration) location.