From 0fca3ab1071ec1c46bcd77e5fe4b6a79a6687417 Mon Sep 17 00:00:00 2001 From: bencergazda Date: Wed, 20 Jul 2022 13:11:57 +0200 Subject: [PATCH] fix: Handle binary files correctly --- src/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index 5179605..769c54f 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -313,13 +313,13 @@ export async function copy_file_or_directory(source_path: string, destination_pa // console.log('COPY', source_path, 'to', destination_path); - const raw_content = await promisified.fse.readFile(source_path, 'utf8'); + const raw_content = await promisified.fse.readFile(source_path); const processed_content = await apply_loaders(raw_content, source_path, destination_path, config); await validate_path(destination_path); - return promisified.fse.writeFile(destination_path, processed_content, 'utf8'); + return promisified.fse.writeFile(destination_path, processed_content); } /**