From 236296f28d9c175ef706155a0947cc198de8358a Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 2 Sep 2024 15:07:15 -0700 Subject: [PATCH] refactor: use $ instead of Glob --- scripts/upgrade-examples.ts | 10 ++-------- tests/test-e2e.ts | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/scripts/upgrade-examples.ts b/scripts/upgrade-examples.ts index fbc6c75..e55fecf 100644 --- a/scripts/upgrade-examples.ts +++ b/scripts/upgrade-examples.ts @@ -1,11 +1,5 @@ -import { $, Glob } from "bun"; +import { $ } from "bun"; -const dirs = new Glob("*").scanSync({ - cwd: "examples", - onlyFiles: false, - absolute: true, -}); - -for await (const dir of dirs) { +for await (const dir of $`find examples -maxdepth 1 -mindepth 1 -type d`.lines()) { await $`cd ${dir} && bun update`; } diff --git a/tests/test-e2e.ts b/tests/test-e2e.ts index de168df..466bcbb 100644 --- a/tests/test-e2e.ts +++ b/tests/test-e2e.ts @@ -1,15 +1,9 @@ -import { $, Glob } from "bun"; +import { $ } from "bun"; import { name } from "../package.json"; await $`bun run build && bun link`; -const dirs = new Glob("*").scanSync({ - cwd: "examples", - onlyFiles: false, - absolute: true, -}); - -for await (const dir of dirs) { +for await (const dir of $`find examples -maxdepth 1 -mindepth 1 -type d`.lines()) { await $`cd ${dir} && bun link ${name}`; await $`cd ${dir} && bun install`; await $`cd ${dir} && bun run build`;