Partially fix external-syncing.

This commit is contained in:
Tom MacWright 2011-01-23 18:46:42 -05:00
parent 87fae5ae0a
commit c63e009acb

View File

@ -169,11 +169,17 @@ var External = function External(env) {
// TODO: make sure dir doesn't exist // TODO: make sure dir doesn't exist
var destination = path.join(that.pos(resource_url), var destination = path.join(that.pos(resource_url),
that.plainname(resource_url)); that.plainname(resource_url));
fs.mkdirSync(that.pos(resource_url), 0777); fs.mkdir(that.pos(resource_url), 0777, function(err) {
fs.renameSync( err && callback(err);
fs.rename(
filename, filename,
destination); destination,
function(err) {
err && callback(err);
callback(null, [resource_url, destination]); callback(null, [resource_url, destination]);
}
)
});
} else { } else {
throw Exception('Non-extended files cannot be processed'); throw Exception('Non-extended files cannot be processed');
} }
@ -261,9 +267,7 @@ var External = function External(env) {
var zf = new zip.ZipFile(filename); var zf = new zip.ZipFile(filename);
var dirname = that.pos(resource_url); var dirname = that.pos(resource_url);
Step( Step(
function uncompress_all() { function uncompress_all() {
var group = this.group(); var group = this.group();
zf.names.forEach(function(name) { zf.names.forEach(function(name) {
var uncompressed = path.join(dirname,name); var uncompressed = path.join(dirname,name);
@ -284,7 +288,6 @@ var External = function External(env) {
}) })
}); });
}, },
function finish_up(err) { function finish_up(err) {
if (err) throw err; if (err) throw err;
callback(null, [ callback(null, [