1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 21:29:42 +00:00
Commit Graph

1153 Commits

Author SHA1 Message Date
Bhadra
2e0714d1fe docs: add Windows platform support section to README 2026-01-08 23:07:55 +05:30
Bhadra
9b40c5acf4 fix(windows): support arrow key escape sequences in interactive menus
Some terminals send escape sequences (ESC [ A/B) instead of VirtualKeyCode
for arrow keys. Now handles both methods for better terminal compatibility.
2026-01-08 22:49:43 +05:30
Bhadra
800db2429d fix(windows): address code review security and reliability issues
- Add protection checks to Go analyze tool before delete operations
- Use try/finally to ensure Windows Update service restarts after cleanup
- Don't count interactive uninstall as automatic success
- Tighten orphaned app detection with stricter prefix matching
2026-01-08 22:25:57 +05:30
Bhadra
3255fa2451 fix(windows): fix CI function name and purge return type handling
- Fix Test-IsProtectedPath -> Test-ProtectedPath in CI workflow
- Fix purge.ps1 to handle boolean return from Remove-SafeItem
- Add C:\Program Files and C:\Program Files (x86) to ProtectedPaths
2026-01-08 21:37:07 +05:30
Bhadra
cfe8ea0724 fix(windows): address code review issues
- Fix openInExplorer to actually execute explorer.exe (was a no-op)
- Load System.Windows.Forms assembly before using Clipboard
- Use Remove-SafeItem in purge for consistent safety checks
- Fix Dropbox typo (was DroplboxCache)
2026-01-08 20:08:41 +05:30
Bhadra
34affd75c4 fix(windows): fix install script directory copy to prevent nesting
- Remove existing directories before copying to prevent nested folder structures (e.g., bin/bin)
- This fixes 'Unknown command' errors after installation
2026-01-08 19:59:51 +05:30
Bhadra
7b03fceaf8 perf(windows): speed up analyze scanning with shallow depth
- Reduce timeout from 5s to 500ms per directory
- Limit scan depth to 3 levels for quick size estimation
- Reduce max files scanned from 50k to 10k
- Results now appear in 1-2 seconds instead of minutes
2026-01-08 19:40:38 +05:30
Bhadra
3653900e2d fix(windows): fix property access errors and scanning performance
- Fix analyze: Add timeout and depth limits to calculateDirSize() to prevent
  indefinite scanning on large directories like user profile
- Fix purge: Add null checks for .Count property access under StrictMode
- Fix uninstall: Wrap registry property access in try/catch for items without
  DisplayName, and add null checks throughout
- Fix mole.ps1: Add null check for Arguments.Count
- Add try/catch around CursorVisible calls for non-interactive terminals

All 73 Pester tests and all Go tests pass.
2026-01-08 19:33:26 +05:30
Bhadra
3ebaeefa18 fix(windows): fix CLI argument passing for switches like -DryRun
- Fix mole.cmd batch launcher to properly pass switch arguments
- Store %~dp0 before parse loop to avoid expansion issues
- Use PowerShell splatting in Invoke-MoleCommand for proper switch handling
- Rename $script:DryRun to $script:MoleDryRunMode in file_ops.ps1 to avoid
  variable shadowing when dot-sourcing
- Handle switches passed as strings (e.g., '-ShowHelp') in mole.ps1 Main()

Fixes issue where 'mole clean -DryRun' would run cleanup instead of preview.
2026-01-08 18:08:59 +05:30
Bhadra
230ca07c7f feat(windows): add Windows support Phase 4 - testing and CI
- Pester test suite for PowerShell scripts (Core, Clean, Commands)
- Go tests for TUI tools (analyze, status)
- GitHub Actions workflow for Windows CI
- Build and test automation scripts (test.ps1, build.ps1)
2026-01-08 16:41:03 +05:30
Bhadra
8a37f63bc7 feat(windows): add Windows support Phase 3 - TUI tools
Add Go-based TUI tools for Windows:
- cmd/analyze: Interactive disk space analyzer with Bubble Tea
- cmd/status: Real-time system health monitor using gopsutil/WMI
- bin/analyze.ps1: Wrapper script for analyze tool
- bin/status.ps1: Wrapper script for status tool
- Makefile: Build automation for Go tools
- Updated README.md with Phase 3 documentation
2026-01-08 16:18:26 +05:30
Bhadra
6e0d850d6a feat(windows): add Windows support Phase 2 - cleanup features
Add cleanup modules and command scripts for Windows:
- lib/clean: user, caches, dev, apps, system cleanup modules
- bin/clean: deep cleanup orchestrator with dry-run and whitelist
- bin/uninstall: interactive app uninstaller
- bin/optimize: system optimization and health checks
- bin/purge: project artifact cleanup

All scripts support dry-run mode and follow safe deletion practices.
2026-01-08 15:46:45 +05:30
Bhadra
a53b48ef3b fix(windows): fix encoding issues in PowerShell scripts
- Simplified banner in install.ps1 and ui.ps1 to avoid Unicode box-drawing
  characters that caused parsing errors on some Windows systems
- Fixed PowerShell 5.1 compatibility for ANSI color codes using [char]27
- Renamed Show-Help to Show-InstallerHelp to avoid potential conflicts
- Changed -Help parameter to -ShowHelp for consistency with mole.ps1
2026-01-08 14:46:05 +05:30
Bhadra
a4b5fe77cf feat(windows): add Windows support Phase 1 - core infrastructure
Add isolated Windows support in windows/ directory with zero changes to existing macOS code.

Phase 1 includes:
- install.ps1: Windows installer with PATH and shortcut support
- mole.ps1: Main CLI entry point with menu system
- lib/core/base.ps1: Core definitions, colors, icons, constants
- lib/core/common.ps1: Common functions loader
- lib/core/file_ops.ps1: Safe file operations with protection checks
- lib/core/log.ps1: Logging functions with colors
- lib/core/ui.ps1: Interactive UI components (menus, confirmations)
- go.mod/go.sum: Go module for future TUI tools
- README.md: Windows-specific documentation

Closes #273
2026-01-08 14:24:11 +05:30
Tw93
64a580b3a7 feat: cat hide toggle and critical fixes (#272)
- Add 'k' key to hide/show cat in mo status
- Hand-crafted mirror frames for better left-walking animation
- Fix extra blank lines bug (strings.Lines → strings.Split)
- Fix battery power overflow (ParseInt for negative values)
- Optimize README Tips section (8 → 5 items)
2026-01-08 11:27:47 +08:00
Tw93
7d6d5eb8b0 Fix the issue with the IDE GoLang cache #269 2026-01-08 10:20:04 +08:00
Tw93
1fccf6bcf8 Repair brew update prompts 2026-01-08 10:16:58 +08:00
Tw93
0d15177735 refactor: remove trimName and renderGPUCard functions 2026-01-06 21:07:51 +08:00
Tw93
c2c589ac81 Merge pull request #264 from alexandear-org/refactor/do-not-use-deprecated-funcs
refactor: replace deprecated `Start` with `Run`
2026-01-06 21:05:10 +08:00
Tw93
f69f53a607 refactor: complete Go modernization with strings.Lines() 2026-01-06 21:03:46 +08:00
Tw93
6ac19a9488 Merge pull request #265 from alexandear-org/refactor/modernize
refactor: modernize Go code
2026-01-06 20:49:27 +08:00
Oleksandr Redko
158af1e1ba refactor: modernize Go code 2026-01-06 12:04:27 +02:00
Oleksandr Redko
80757ec074 refactor: replace deprecated Start with Run 2026-01-06 11:46:59 +02:00
Tw93
62ef283943 feat: refine ZIP installer detection to handle many entries and app bundles, and update AI agent development guide 2026-01-05 10:30:45 +08:00
Tw93
07ea303105 feat: enhance optimization summary with specific metrics for cleaned cache, repaired configs, and optimized databases 2026-01-05 00:26:08 +08:00
Tw93
797c069e89 Test to prevent uninstall local 2026-01-04 23:52:47 +08:00
Tw93
2fac1e1dea Merge branch 'main' of github.com:tw93/Mole 2026-01-04 23:21:37 +08:00
Tw93
e434a1e837 feat(uninstall): add support for third-party input methods
- Add '/Library/Input Methods' to application scan paths
- Unprotect Sogou, QQ, and Baidu input methods from system critical list
- Enhance file cleanup logic to detect input method plugins and caches
- Allow clean uninstallation and deep cleaning of WeType, Sogou, etc.
2026-01-04 23:19:02 +08:00
Tw93
8a0b98525c fix(install): implement atomic update to prevent binary corruption
- Use temporary files (*.new) during installation process
- Perform atomic 'mv -f' operation to replace binaries
- Prevent partial updates if process is interrupted/fails
- Fixes critical issue where failed update deleted existing app
2026-01-04 23:17:42 +08:00
Tw93
b044fa3e60 chore: auto format code 2026-01-04 09:52:09 +00:00
Tw93
3906c020fe fix: improve cleanup by exiting alt screen and refine whitelisting for directory paths and R renv cache. 2026-01-04 17:41:14 +08:00
Tw93
aedeed1817 fix: refine terminal alt screen management with IN_ALT_SCREEN flag and conditional message display 2026-01-04 17:38:32 +08:00
Tw93
768b1bf274 docs: add --debug flag documentation and update tests
- Add --dry-run --debug usage examples to README
- Add detailed preview tip explaining debug log features
- Update tests/clean_core.bats for debug functionality
- Closes GitHub issue #242
2026-01-04 17:30:49 +08:00
Tw93
0520287ec1 feat(debug): add detailed debug output for optimize operations
- Add debug logging to all optimize functions:
  - opt_cache_refresh, opt_saved_state_cleanup
  - opt_network_optimization, opt_sqlite_vacuum
  - opt_launch_services_rebuild, opt_font_cache_rebuild
  - opt_memory_pressure_relief, opt_disk_permissions_repair
  - opt_bluetooth_reset
- Each operation logs description, method, expected outcome, and risk level
- Part of GitHub issue #242 implementation
2026-01-04 17:30:45 +08:00
Tw93
9d59649b51 feat(debug): add detailed debug output for clean operations
- Add classify_cleanup_risk() for risk level classification (LOW/MEDIUM/HIGH)
- Enhance safe_clean() with operation details and risk info
- Show item counts and file lists in debug mode
- Support for lib/clean/user.sh debug enhancements
- Part of GitHub issue #242 implementation
2026-01-04 17:30:41 +08:00
Tw93
cd5baf9a72 feat(debug): enhance file removal with detailed debug output
- Add file metadata logging in safe_remove() and safe_sudo_remove()
- Log file type, size, and age when in debug mode
- Support both dry-run and actual removal scenarios
- Part of GitHub issue #242 implementation
2026-01-04 17:30:36 +08:00
Tw93
e5a3abfd6d feat(debug): add enhanced debug logging functions
- Add debug_operation_start() for operation section headers
- Add debug_operation_detail() for detailed operation info
- Add debug_file_action() for file operations with metadata
- Add debug_risk_level() for risk classification with colors
- All functions output to both stderr and log file
- Addresses GitHub issue #242
2026-01-04 17:30:32 +08:00
Tw93
fc4d94f7c7 Merge pull request #247 from JackPhallen/feat/more-purge-support
feat(purge): C# bin purge support
2026-01-04 16:16:59 +08:00
Tw93
0df0de33f5 Merge pull request #248 from JackPhallen/fix/protect-whitelisted-subdirectories
fix: Respect whitelisted subdirectories
2026-01-04 16:12:39 +08:00
Tw93
b5dc0a556d Merge pull request #246 from JackPhallen/feat/purge-python-paths
feat(purge): Additional python purge targets
2026-01-04 16:08:25 +08:00
Tw93
4ed7c9a75a Merge pull request #245 from JackPhallen/chore/skip-tests-requiring-timeout
chore: Skip tests that require timeout
2026-01-04 16:05:38 +08:00
Jack Phallen
70e1544490 fix: Respect whitelisted subdirectories 2026-01-04 00:00:28 -08:00
Tw93
9f504dc249 feat: implement installer cleanup functionality, add ZIP and file descriptor installer tests, and update README 2026-01-04 15:46:48 +08:00
Jack Phallen
aabee42344 feat(purge): C# bin purge support 2026-01-03 23:24:25 -08:00
Jack Phallen
2045917c23 feat(purge): Additional python purge targets 2026-01-03 22:54:37 -08:00
Jack Phallen
5fa0ea403b chore: Skip tests that require timeout 2026-01-03 22:17:28 -08:00
Tw93
ad42266b09 refactor: rename installers command to installer across commands, script, and documentation. 2026-01-04 10:23:23 +08:00
Tw93
4680982ea1 Merge pull request #240 from JackPhallen/feat/installers-clean
feat: Create utility to find stale app installers
2026-01-04 10:12:00 +08:00
Tw93
26a380c2cd docs: enhance AI agent guide with detailed safety, architecture, and workflow instructions. 2026-01-04 10:10:11 +08:00
Jack Phallen
a2f071fd48 feat: Create utility to find stale app installers 2026-01-03 10:00:57 -08:00