mongo-migrate icon indicating copy to clipboard operation
mongo-migrate copied to clipboard

Bin do not work because of windows line ending format

Open coderaiser opened this issue 9 years ago • 1 comments

Mongo-migrate version located on npm contains cariage returns:

#!/usr/bin/env node^M¬
  2 ^M¬
  3 require('../index.js');^M¬

And this is the reason why bin/mongo-migrate.js doesn't work on linux and mac os (do not know about winsows).

And this is why you suggest to use:

node ./node_modules/mongodb-migrate -runmm create

Insteed of:

mongodb-migrate -runmm create

Could you please fix version on npm (you could use dos2unix for this purpose) and create alias with same bin name as npm-package called: mongodb-migrate.

coderaiser avatar Mar 31 '16 14:03 coderaiser

Have just encountered this issue on Mac. The solution is simple:

brew install dos2unix
dos2unix ./node_modules/mongodb-migrate/bin/mongo-migrate.js

However, it won't let me create a Pull Request because git doesn't see it as a change in the repo.

Therefore, until it's fixed, i'm resorting to ./node_modules/.bin/mongo-migrate instead of mongo-migrate to be cross platform.

catamphetamine avatar Apr 09 '16 11:04 catamphetamine