Skip to content

Commit

Permalink
Merge branch 'hotfix/preinstall'
Browse files Browse the repository at this point in the history
  • Loading branch information
mulder21c committed Apr 27, 2019
2 parents c3ce35e + c0b9971 commit 437cfcc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions copy-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ const webfontLoader = require.resolve('webfontloader');
async function checkDirectory(name) {
let sourcePath = path.join('./source', name);

await fs.access(path.join(__dirname, sourcePath), F_OK, (err) => {
if(err) fs.mkdirSync(path.join(__dirname, sourcePath));
});

return path.join(__dirname, sourcePath);
return new Promise( resolve => {
fs.access(path.join(__dirname, sourcePath), F_OK, (err) => {
if(err) {
fs.mkdirSync(path.join(__dirname, sourcePath));
}
resolve(path.join(__dirname, sourcePath))
});
})
}

checkDirectory('fonts')
Expand Down

0 comments on commit 437cfcc

Please sign in to comment.