Skip to content

Commit

Permalink
Prevent copying src folder if folder is already present
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-cologne committed Jun 20, 2019
1 parent 0c53d42 commit b4877eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,11 @@ const copyAdditionalFiles = async directory => {
const projectPath = (directory !== '') ? `${ directory }/` : '';

try {
await fs
.copy(path.join(__dirname, '../src'), `${ projectPath }src`);
if (!fs.existsSync(`${ projectPath }src`)) {
await fs
.copy(path.join(__dirname, '../src'), `${ projectPath }src`);
}

return true;
} catch (err) {
console.error(err);
Expand Down

0 comments on commit b4877eb

Please sign in to comment.