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

Remove -runmm flag #8

Closed
orbitbot opened this issue Sep 20, 2013 · 1 comment
Closed

Remove -runmm flag #8

orbitbot opened this issue Sep 20, 2013 · 1 comment

Comments

@orbitbot
Copy link

Apparently, the package does not perform actions without the -runmm argument? Having to add the argument seems very superfluous to me, and I couldn't think of a situation where functionality of CLI tools would require this for basic operations.

@afloyd
Copy link
Owner

afloyd commented Oct 3, 2013

The -runmm argument specifies that you are running mongo-migrate from the command line and not as a module... It probably could be adapted to run without this specification, but that's more work than I plan on putting into it at this time. Feel free to fork the repo & make the modifications if you would like though :)

I'm using it from the command line myself in the project I created it for at work, and have just written a node "batch file" called migrate.js to handle easily kicking off my migration as follows:

var exec = require('child_process').exec,
    args = process.argv.slice(2);

var executionString = 'node ./node_modules/mongo-migrate -runmm ' + args.join(' ');
console.log('Running migrations via command line: \n\t' + executionString + '\n\n');
exec(executionString, function (err, stdout, stderr) {
    if (err) {
        console.error('Migration execution error: ', err);
    }

    console.log('output: \n', stdout);
    console.log('errors: \n', stderr || '\tnone');
    process.exit();
});

Which can then be kicked off simply via node migrate from within my project directory root where migrate.js resides...

Cheers,
Austin

@afloyd afloyd closed this as completed Oct 3, 2013
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

2 participants