Skip to content

Commit 2a41fca

Browse files
committed
fix(brew): handle root-owned config dir from sudo installs
- Make all post-install setup steps non-fatal using a bestEffort() wrapper so Homebrew's post_install never aborts on permission errors - In tryRepairReadonly(), detect root-owned files (uid 0) and emit a targeted message with the actual username instead of falling through to the generic warning - Add ownership detection and repair to `sentry cli fix`: - Checks config dir / DB / WAL / SHM file ownership - When run as root (sudo sentry cli fix), performs chown to transfer ownership back to the real user (inferred from SUDO_USER env var) - When not root, prints the exact sudo chown command to run
1 parent 14490e7 commit 2a41fca

File tree

7 files changed

+794
-75
lines changed

7 files changed

+794
-75
lines changed

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Read the full guidelines in `.cursor/rules/bun-cli.mdc`.
7777
| Write file | `await Bun.write(path, content)` | `fs.writeFileSync()` |
7878
| Check file exists | `await Bun.file(path).exists()` | `fs.existsSync()` |
7979
| Spawn process | `Bun.spawn()` | `child_process.spawn()` |
80-
| Shell commands | `Bun.$\`command\`` | `child_process.exec()` |
80+
| Shell commands | `Bun.$\`command\`` ⚠️ | `child_process.exec()` |
8181
| Find executable | `Bun.which("git")` | `which` package |
8282
| Glob patterns | `new Bun.Glob()` | `glob` / `fast-glob` packages |
8383
| Sleep | `await Bun.sleep(ms)` | `setTimeout` with Promise |
@@ -89,6 +89,12 @@ import { mkdirSync } from "node:fs";
8989
mkdirSync(dir, { recursive: true, mode: 0o700 });
9090
```
9191

92+
**Exception**: `Bun.$` (shell tagged template) has no shim in `script/node-polyfills.ts` and will crash on the npm/node distribution. Until a shim is added, use `execSync` from `node:child_process` for shell commands that must work in both runtimes:
93+
```typescript
94+
import { execSync } from "node:child_process";
95+
const result = execSync("id -u username", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] });
96+
```
97+
9298
## Architecture
9399

94100
```

0 commit comments

Comments
 (0)