Skip to content

Commit

Permalink
-> 0.6.8, contains fix for #18
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Oct 22, 2014
1 parent 9552dc0 commit a19bbc7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.6.8

* Fix for ([#18](https://github.com/gobblejs/gobble/issues/18))

## 0.6.7

* Nodes clean up after themselves on each successful build, to avoid lengthy subsequent startup times ([#16](https://github.com/gobblejs/gobble/issues/16))
Expand Down
12 changes: 7 additions & 5 deletions lib/nodes/Merger.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ module.exports = Node.extend({
},

ready: function () {
var node = this, outputdir;
var node = this, index, outputdir;

if ( !node._ready ) {
outputdir = path.resolve( session.config.gobbledir, node.id, '' + node.counter++ );
index = node.counter++;
outputdir = path.resolve( session.config.gobbledir, node.id, '' + index );

node._ready = sander.mkdir( outputdir ).then( function () {
var start, inputdirs = [];

Expand All @@ -48,7 +50,7 @@ module.exports = Node.extend({
return merge( inputdir ).to( outputdir );
});
}).then( function () {
node._cleanup( outputdir );
node._cleanup( index );

node.emit( 'info', {
code: 'MERGE_END',
Expand Down Expand Up @@ -115,13 +117,13 @@ module.exports = Node.extend({
return null;
},

_cleanup: function ( latest ) {
_cleanup: function ( index ) {
var node = this, dir = path.join( session.config.gobbledir, node.id );

// Remove everything except the last successful output dir.
// Use readdirSync to eliminate race conditions
sander.readdirSync( dir ).filter( function ( file ) {
return file !== '.cache' && path.resolve( dir, file ) !== latest;
return file !== '.cache' && ( +file < index );
}).forEach( function ( file ) {
sander.rimrafSync( dir, file );
});
Expand Down
4 changes: 0 additions & 4 deletions lib/nodes/Source.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ module.exports = Node.extend({
});

node.emit( 'error', error );

node.emit( 'ready', node.dir );

//node._relay({ gobble: 'INVALIDATE', changes: changes }, node.dir );
changes = [];
}, 100 );

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gobble",
"description": "The last build tool you'll ever need",
"version": "0.6.7",
"version": "0.6.8",
"author": "Rich Harris",
"license": "MIT",
"repository": "https://github.com/gobblejs/gobble",
Expand Down

0 comments on commit a19bbc7

Please sign in to comment.