Skip to content

Commit

Permalink
Cleanup index.js
Browse files Browse the repository at this point in the history
* Remove dependencies on `fs-extra` and `url-join`
* Remove unused declarations from `index.js`
* No longer copy `index.html` into assets
  • Loading branch information
seanpdoyle committed Dec 10, 2015
1 parent cadb98a commit fd6d6ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
master
------

* Remove dependency on `url-join` and `fs-extra` packages.
* Simplify inclusion logic thanks to removal of sprockets. [#25]

[#25]: https://github.com/rondale-sc/ember-cli-rails-addon/pull/25
Expand Down
17 changes: 2 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
var fs = require('fs');
var fsExtra = require('fs-extra');
var path = require('path');
var urlJoin = require('url-join');

function softSet(object, key, value) {
object = object || {};

if (typeof object[key] === 'undefined') {
object[key] = value;
}
}

module.exports = {
name: 'ember-cli-rails-addon',
Expand Down Expand Up @@ -46,18 +36,15 @@ module.exports = {
});
}
},

preBuild: function(result) {
var lockFile = this.lockFilePath();
var errorFile = this.errorFilePath();
if(!fs.existsSync(lockFile)) { fs.openSync(lockFile, 'w'); }
if(fs.existsSync(errorFile)) { fs.unlinkSync(errorFile); }
},
postBuild: function(result){
fsExtra.copySync(
result.directory + '/index.html',
result.directory + '/assets/index.html'
);

postBuild: function(result){
var lockFile = this.lockFilePath();

if(fs.existsSync(lockFile)) {
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
],
"author": "Jonathan Jackson",
"license": "ISC",
"dependencies": {
"fs-extra": "^0.26.0",
"url-join": "0.0.1"
},
"devDependencies": {
"qunit": "^0.7.7"
}
Expand Down

0 comments on commit fd6d6ba

Please sign in to comment.