-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Windows compatibility for delete, size, and path separators #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
61e3bfb
38e9978
f025cfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install | ||
|
|
||
| - name: Type check | ||
| run: bun run check | ||
|
|
||
| - name: Build | ||
| run: bun run build | ||
|
|
||
| - name: Smoke test - help | ||
| run: bun run src/cli.ts --help | ||
|
|
||
| - name: Smoke test - dry-run (Unix) | ||
| if: runner.os != 'Windows' | ||
| run: bun run src/cli.ts --dir ${{ github.workspace }} --dry-run --hide-errors | ||
|
|
||
| - name: Smoke test - dry-run (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: bun run src/cli.ts --dir ${{ github.workspace }} --dry-run --hide-errors | ||
| shell: pwsh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,15 +29,22 @@ BunKill scans large directory trees, calculates folder sizes, and lets you delet | |
|
|
||
| ## Requirements | ||
|
|
||
| - Bun is required at runtime | ||
| - macOS is the only platform tested so far | ||
| - [Bun](https://bun.sh) runtime is required | ||
| - Supported platforms: **macOS**, **Linux**, **Windows 10/11** | ||
| - Windows: requires [Windows Terminal](https://aka.ms/terminal) for best interactive UI experience | ||
|
|
||
| Install Bun if needed: | ||
| **Install Bun:** | ||
|
|
||
| macOS / Linux: | ||
| ```bash | ||
| curl -fsSL https://bun.sh/install | bash | ||
| ``` | ||
|
|
||
| Windows (PowerShell): | ||
| ```powershell | ||
| powershell -c "irm bun.sh/install.ps1 | iex" | ||
| ``` | ||
|
|
||
| ## Install | ||
|
|
||
| ```bash | ||
|
|
@@ -56,9 +63,12 @@ bun install -g bunkill | |
| # interactive scan in current directory | ||
| bunkill | ||
|
|
||
| # scan a specific directory | ||
| # scan a specific directory (macOS / Linux) | ||
| bunkill --dir ~/Projects | ||
|
|
||
| # scan a specific directory (Windows) | ||
| bunkill --dir "C:\Users\YourName\Projects" | ||
|
|
||
| # preview only | ||
| bunkill --dir ~/Projects --dry-run | ||
|
|
||
|
|
@@ -101,13 +111,14 @@ Search filters the already loaded list, so you can quickly narrow large result s | |
|
|
||
| ## Platform status | ||
|
|
||
| - macOS: tested | ||
| - Linux: not tested yet | ||
| - Windows: not tested yet | ||
|
|
||
| Linux and Windows may work, but they have not been validated in this repo yet. | ||
| | Platform | Status | | ||
| |---|---| | ||
| | macOS | ✅ Tested | | ||
| | Linux | ⚠️ Not tested yet | | ||
| | Windows 10/11 | ✅ Tested (Windows Terminal recommended) | | ||
|
Comment on lines
+114
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align Linux platform status with the new CI matrix. Line 117 currently says Linux is “Not tested yet”, but this PR adds Linux CI runs. Please update wording to avoid contradictory platform claims. 🤖 Prompt for AI Agents
Comment on lines
+114
to
+118
|
||
|
|
||
| Contributions for Linux and Windows testing or fixes are welcome. | ||
| > **Windows note:** Interactive mode requires a terminal that supports ANSI escape codes and raw mode. | ||
| > [Windows Terminal](https://aka.ms/terminal) works well. The legacy `cmd.exe` prompt is not supported. | ||
|
|
||
| ## Performance | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import { stat } from "node:fs/promises"; | |||||||||
| import { basename, join, resolve } from "node:path"; | ||||||||||
| import { filesize } from "filesize"; | ||||||||||
| import { APP_CONFIG } from "./config.ts"; | ||||||||||
| import { deleteModules, scan as scanEngine } from "./scanner.ts"; | ||||||||||
| import { deleteModules, normalizeProjectPath, scan as scanEngine } from "./scanner.ts"; | ||||||||||
| import type { NodeModule, ScanOptions } from "./types.ts"; | ||||||||||
|
|
||||||||||
| const LOGO = ` | ||||||||||
|
|
@@ -558,7 +558,7 @@ class BunKill { | |||||||||
| } | ||||||||||
|
|
||||||||||
| this.pendingUiMeta.add(module.path); | ||||||||||
| const projectPath = module.path.replace(/\/node_modules$/, ""); | ||||||||||
| const projectPath = normalizeProjectPath(module.path); | ||||||||||
|
||||||||||
| const projectPath = normalizeProjectPath(module.path); | |
| const projectPath = | |
| (module as any).projectRoot ?? | |
| normalizeProjectPath(module.path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI uses
bun-version: latest, which can make builds non-deterministic and introduce sudden breakages when Bun releases. Consider pinning to a specific Bun version (or at least the minimum supported in package.json engines) and optionally adding a separate scheduled job forlatestif you want early warning.