Commit 10c3759
committed
Puppeteer/Playwright uninstall: resolve path via load() then rmtree
``puppeteer-browsers clear`` wipes the whole cache (no per-browser
filter) and ``playwright uninstall`` rejects browser-name arguments,
so neither CLI can do the per-browser uninstall abxpkg exposes.
Switch both uninstall handlers to:
1. ``self.load(bin_name, no_cache=True)`` — playwright-core's
``executablePath()`` / puppeteer-browsers' ``list`` already read
the right path from the subprocess env, so load() handles all
three cases uniformly:
- managed ``install_root`` → abxpkg exports the env var itself
- unmanaged default → CLI's own OS default
- custom ``PUPPETEER_CACHE_DIR`` / ``PLAYWRIGHT_BROWSERS_PATH`` →
ambient env passes through via ``build_exec_env``
2. Walk up from the resolved abspath to find the browser's top-level
dir (``<cache>/<browser_name>/`` for puppeteer,
``<cache>/<browser_name>-<buildId>/`` for playwright) and rmtree
it.
No more ``self.cache_dir`` lookups in either uninstall handler, and
the existing ``bin_dir`` symlink cleanup still runs first so ``load``
stops resolving a stale shim if rmtree fails partway through.1 parent 20b1d6f commit 10c3759
2 files changed
Lines changed: 45 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
743 | | - | |
744 | | - | |
| 742 | + | |
| 743 | + | |
745 | 744 | | |
746 | 745 | | |
747 | 746 | | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
759 | 768 | | |
760 | 769 | | |
761 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
703 | | - | |
| 702 | + | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
714 | 729 | | |
0 commit comments