Skip to content

Commit

Permalink
fix: don't copy if src doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Mar 10, 2021
1 parent 754283d commit ebccc79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/upgrades/1.17.0/default_favicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ module.exports = {
method: async function () {
const pathToIco = path.join(nconf.get('upload_path'), 'system', 'favicon.ico');
const defaultIco = path.join(nconf.get('base_dir'), 'public', 'favicon.ico');
const exists = await file.exists(pathToIco);
if (!exists) {
const targetExists = await file.exists(pathToIco);
const defaultExists = await file.exists(defaultIco);
if (defaultExists && !targetExists) {
await fs.promises.copyFile(defaultIco, pathToIco);
}
},
Expand Down

0 comments on commit ebccc79

Please sign in to comment.