Skip to content

Commit

Permalink
Fixes a few bugs affecting the tests. (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick authored and Matt Gaunt committed Jun 27, 2017
1 parent 7540da3 commit e7e3e13
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions src/download-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class DownloadManager {

fse.copySync(
path.join(mountedPath, chromeOSXAppName),
path.join(installDir, 'chrome', release, chromeOSXAppName)
path.join(installDir, 'chrome', release, chromeOSXAppName),
{dereference: true}
);

dmg.unmount(mountedPath, (err) => {
Expand All @@ -267,7 +268,9 @@ class DownloadManager {
}
})
.then((filePath) => {
return del(filePath, {force: true});
if (filePath) {
return del(filePath, {force: true});
}
});
}

Expand Down Expand Up @@ -375,7 +378,8 @@ class DownloadManager {

fse.copySync(
path.join(mountedPath, firefoxMacApp),
path.join(installDir, 'firefox', release, firefoxMacApp)
path.join(installDir, 'firefox', release, firefoxMacApp),
{dereference: true}
);

dmg.unmount(mountedPath, (err) => {
Expand All @@ -392,7 +396,9 @@ class DownloadManager {
throw new Error('Unable to handle downloaded file: ', downloadUrl);
})
.then((filePath) => {
return del(filePath, {force: true});
if (filePath) {
return del(filePath, {force: true});
}
});
}

Expand Down Expand Up @@ -608,7 +614,9 @@ class DownloadManager {
}
})
.then((filePath) => {
return del(filePath, {force: true});
if (filePath) {
return del(filePath, {force: true});
}
});
}
}
Expand Down

0 comments on commit e7e3e13

Please sign in to comment.