mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-16 00:35:22 +00:00
set downloaded flag at the very end
This commit is contained in:
parent
9887a2204d
commit
fc0825aeca
@ -12,6 +12,7 @@ class File {
|
|||||||
this.path = options.path;
|
this.path = options.path;
|
||||||
this.basedir = options.basedir;
|
this.basedir = options.basedir;
|
||||||
this.resolver = options.resolver;
|
this.resolver = options.resolver;
|
||||||
|
this.downloadedImports = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
parseFileForImport(content, isHttpContract, callback) {
|
parseFileForImport(content, isHttpContract, callback) {
|
||||||
@ -52,12 +53,12 @@ class File {
|
|||||||
// We already parsed this file
|
// We already parsed this file
|
||||||
return callback(null, newContent);
|
return callback(null, newContent);
|
||||||
}
|
}
|
||||||
self.downloadedImports = true;
|
|
||||||
async.each(filesToDownload, ((fileObj, eachCb) => {
|
async.each(filesToDownload, ((fileObj, eachCb) => {
|
||||||
self.downloadFile(fileObj.fileRelativePath, fileObj.url, (_content) => {
|
self.downloadFile(fileObj.fileRelativePath, fileObj.url, (_content) => {
|
||||||
eachCb();
|
eachCb();
|
||||||
});
|
});
|
||||||
}), (err) => {
|
}), (err) => {
|
||||||
|
self.downloadedImports = true;
|
||||||
callback(err, newContent);
|
callback(err, newContent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -98,7 +99,7 @@ class File {
|
|||||||
fs.readFile(filename, next);
|
fs.readFile(filename, next);
|
||||||
},
|
},
|
||||||
function parseForImports(content, next) {
|
function parseForImports(content, next) {
|
||||||
self.parseFileForImport(content, true, (err) => {
|
self.parseFileForImport(content.toString(), true, (err) => {
|
||||||
next(err, content);
|
next(err, content);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user