Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (!outfile) {
console.error('You MUST specify an outfile with -o.');
process.exit(1);
}
var dotfile = path.join(path.dirname(outfile), '.' + path.basename(outfile));

w.on('update', bundle);
bundle();
Expand All @@ -28,20 +27,17 @@ function bundle () {
if (err) console.error(err);
})
});
wb.pipe(fs.createWriteStream(dotfile));
wb.pipe(fs.createWriteStream(outfile));

var bytes, time;
w.on('bytes', function (b) { bytes = b });
w.on('time', function (t) { time = t });

wb.on('end', function () {
fs.rename(dotfile, outfile, function (err) {
if (err) return console.error(err);
if (verbose) {
console.error(bytes + ' bytes written to ' + outfile
+ ' (' + (time / 1000).toFixed(2) + ' seconds)'
);
}
});
if (verbose) {
console.error(bytes + ' bytes written to ' + outfile
+ ' (' + (time / 1000).toFixed(2) + ' seconds)'
);
}
});
}