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
var destination = path.join(that.pos(resource_url),
that.plainname(resource_url));
fs.mkdirSync(that.pos(resource_url), 0777);
fs.renameSync(
filename,
destination);
callback(null, [resource_url, destination]);
fs.mkdir(that.pos(resource_url), 0777, function(err) {
err && callback(err);
fs.rename(
filename,
destination,
function(err) {
err && callback(err);
callback(null, [resource_url, destination]);
}
)
});
} else {
throw Exception('Non-extended files cannot be processed');
}
@ -261,9 +267,7 @@ var External = function External(env) {
var zf = new zip.ZipFile(filename);
var dirname = that.pos(resource_url);
Step(
function uncompress_all() {
var group = this.group();
zf.names.forEach(function(name) {
var uncompressed = path.join(dirname,name);
@ -284,7 +288,6 @@ var External = function External(env) {
})
});
},
function finish_up(err) {
if (err) throw err;
callback(null, [