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

Migration commands break when there is a bad .DS_store in the migrations directory #96

Closed
webdevian opened this issue Feb 6, 2017 · 0 comments

Comments

@webdevian
Copy link
Contributor

When there is a hidden file containing illegal tokens in database/migrations, the ace migrate commands fail.

Steps to reproduce

On MacOS, delete a file from the migrations directory in finder, then restore it from the trash. This creates a .DS_store file, which contains invalid characters. Then using any migration command exits with error SyntaxError: Invalid or unexpected token

There could be other situations that create bad .DS_store files.

I believe it is a zero-width space (U+200B) that causes it to throw the syntax error.

Possible solution

It breaks on this line, when it tries to map the files - https://github.com/adonisjs/adonis-lucid/blob/develop/lib/util.js#L286
It would be solved by filtering out hidden files before loading all files in the directory, I'm not sure of the best method for this though.

I also noticed the docblock on the loadJsFiles method is missing a param

thetutlage added a commit that referenced this issue Jul 16, 2017
use require-all instead of auto-loader, since autoloader select all files before filtering them,

which causes an error when a non-js file is loaded

Closes #96
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

1 participant