Skip to content

Commit 1d53441

Browse files
YaroShkvorets0237h
andauthored
combine ifs
Co-authored-by: Etienne Donneger <[email protected]>
1 parent 1ed6c12 commit 1d53441

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/cli/src/command-helpers/scaffold.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ const writeScaffoldDirectory = async (scaffold: any, directory: string, spinner:
108108
const filename = path.join(directory, basename);
109109

110110
// Write file or recurse into subdirectory
111-
if (typeof content === 'string') {
111+
if (typeof content === 'string' || Buffer.isBuffer(content)) {
112112
await fs.writeFile(filename, content, 'utf-8');
113-
} else if (Buffer.isBuffer(content)) {
114-
await fs.writeFile(filename, content);
115113
} else if (content == null) {
116114
return; // continue loop
117115
} else {

0 commit comments

Comments
 (0)