Skip to content

Commit

Permalink
combine ifs
Browse files Browse the repository at this point in the history
Co-authored-by: Etienne Donneger <[email protected]>
  • Loading branch information
YaroShkvorets and 0237h authored Dec 10, 2024
1 parent 1ed6c12 commit 1d53441
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/cli/src/command-helpers/scaffold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ const writeScaffoldDirectory = async (scaffold: any, directory: string, spinner:
const filename = path.join(directory, basename);

// Write file or recurse into subdirectory
if (typeof content === 'string') {
if (typeof content === 'string' || Buffer.isBuffer(content)) {
await fs.writeFile(filename, content, 'utf-8');
} else if (Buffer.isBuffer(content)) {
await fs.writeFile(filename, content);
} else if (content == null) {
return; // continue loop
} else {
Expand Down

0 comments on commit 1d53441

Please sign in to comment.