Fix failures on Travis due to broken isDir
This commit is contained in:
parent
3f32523709
commit
c2ebcc9dbc
|
@ -796,7 +796,16 @@ Zotero.Attachments = new function(){
|
|||
throw new Error("'item' must be a Zotero.Item");
|
||||
}
|
||||
var dir = this.getStorageDirectory(item).path;
|
||||
yield OS.File.removeDir(dir, { ignoreAbsent: true });
|
||||
// Testing for directories in OS.File, used by removeDir(), is broken on Travis, so use nsIFile
|
||||
if (Zotero.automatedTest) {
|
||||
let nsIFile = Zotero.File.pathToFile(dir);
|
||||
if (nsIFile.exists()) {
|
||||
nsIFile.remove(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
yield OS.File.removeDir(dir, { ignoreAbsent: true });
|
||||
}
|
||||
yield Zotero.File.createDirectoryIfMissingAsync(dir);
|
||||
return dir;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user