From 3c7a28ceb216028d045ef2de62e4daf3a6932973 Mon Sep 17 00:00:00 2001 From: Alois Date: Sun, 28 Jun 2026 19:10:23 +0200 Subject: [PATCH] Reapply "(fix): now run builds in nix shell" This reverts commit 10da530e9ecf8afac13d8542193acab2b8ed6b48. --- package.json | 6 ++++-- scripts/build-packages.ts | 2 +- scripts/lint-packages.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0fc8932..5458b53 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,15 @@ "type": "module", "scripts": { "format": "bunx prettier --write .", - "lint": "bun scripts/lint-packages.ts", + "lint": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop .#electron --command bun run lint:raw; else bun run lint:raw; fi", + "lint:raw": "bun scripts/lint-packages.ts", "check": "fallow && bun run lint", "copy-licenses": "bun scripts/copy-licenses.ts", "copy-releases": "bun scripts/copy-releases.ts", "pre-build": "bun run lint && bun run build:packages", "build:apps": "bun run copy-licenses && bun run pre-build && bun run build:mobile && bun run build:desktop && bun --bun run copy-releases", - "build:packages": "bun scripts/build-packages.ts", + "build:packages": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop .#electron --command bun run build:packages:raw; else bun run build:packages:raw; fi", + "build:packages:raw": "bun scripts/build-packages.ts", "update:packages": "bun scripts/update-packages.ts", "dev:web": "cd apps/web && bun dev", "build:web": "cd apps/web && bun run build", diff --git a/scripts/build-packages.ts b/scripts/build-packages.ts index 3656461..0f4991a 100644 --- a/scripts/build-packages.ts +++ b/scripts/build-packages.ts @@ -34,7 +34,7 @@ for (const fullPath of packageDirs) { const entry = fullPath.replace(packagesDir + "/", ""); console.log(`Building ${entry}...`); try { - execSync("bun --bun run build", { cwd: fullPath, stdio: "inherit" }); + execSync("bun run build", { cwd: fullPath, stdio: "inherit" }); console.log(`${entry} built successfully.`); } catch { console.error(`Failed to build ${entry}.`); diff --git a/scripts/lint-packages.ts b/scripts/lint-packages.ts index ccfe5e4..b9abdf2 100644 --- a/scripts/lint-packages.ts +++ b/scripts/lint-packages.ts @@ -36,7 +36,7 @@ for (const targetDir of targetDirs) { const entry = relative(rootDir, fullPath); console.log(`Linting ${entry}...`); try { - execSync("bun --bun run lint", { cwd: fullPath, stdio: "inherit" }); + execSync("bun run lint", { cwd: fullPath, stdio: "inherit" }); console.log(`${entry} linted successfully.`); } catch { console.error(`Failed to lint ${entry}.`);