rpflorence/ember-tools — pull request #107 by scribu (2013-11-21 13:19:15+00:00)
Title: `ember build` fails when Vim backup files present

When editing a file in Vim, it creates backup files which end with a `~`.

`ember build` picks up these files, instead of only reading files that end with `.js`:

```
Error: Parsing file /app/js/index.js: Line 10: Unexpected token ~

/Users/User/git/ember-tools/src/commands/build.js:104
if (error && !env.watch) throw new Error(error);
^
Error: Error: Command failed: Error: Parsing file /app/js/index.js: Line 10: Unexpected token ~

at /Users/User/git/ember-tools/src/commands/build.js:104:36
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket. (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
```

The generated `index.js` file looks like this:

```js
// This file is auto-generated by `ember build`.
// You should not modify it.

var App = window.App = require('./config/app');
require('./templates');

App.AuthorizeIndexController = require('./controllers/authorize_index_controller');
App.AuthorizeIndexController.js~ = require('./controllers/authorize_index_controller.js~');

require('./config/routes');

module.exports = App;
```

I'll open a PR if I manage to fix it.