From ef6d25a48fd6aa73341a30f061d246ee198a24b4 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Wed, 2 Aug 2023 17:55:42 -0700 Subject: Fix --- examples/macros/matchInFile.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/macros/matchInFile.tsx') diff --git a/examples/macros/matchInFile.tsx b/examples/macros/matchInFile.tsx index e434d1dec..4793661d9 100644 --- a/examples/macros/matchInFile.tsx +++ b/examples/macros/matchInFile.tsx @@ -1,12 +1,12 @@ // macro code -export function matchInFile(callExpression: BunAST.CallExpression) { +export async function matchInFile(callExpression: BunAST.CallExpression) { const [filePathNode, matcherNode] = callExpression.arguments; let filePath: string; filePath = filePathNode.get(); let matcher: RegExp; matcher = matcherNode.get(); - const file: string = Bun.readFile(Bun.cwd + filePath); + const file: string = await Bun.file(Bun.cwd + filePath).text(); return ( -- cgit v1.2.3