afloyd / mongo-migrate

MIT License
159 stars 81 forks source link

Bin do not work because of windows line ending format #57

Open coderaiser opened 8 years ago

coderaiser commented 8 years ago

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.

catamphetamine commented 8 years ago

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.