The AppMap plugin currently does not clean up older versions of AppMap binaries located in the $HOME/.appmap (Linux/macOS) or %HOME%/.appmap (Windows) directory. This can lead to unnecessary storage usage as multiple old versions accumulate over time. The goal is to remove all older versions of the binaries and ensure that only the most recent version is retained moving forward.
Analysis
To resolve this issue, we need to implement a cleanup function that scans the AppMap binaries directory and deletes all but the most recent binary. The most recent binary can be determined by the semver version number in the file name.
Furthermore, we should integrate this cleanup function to be automatically executed whenever a new AppMap binary is downloaded or installed. This ensures that the directory is consistently maintained with only the latest version, preventing storage bloat.
Problem
The AppMap plugin currently does not clean up older versions of AppMap binaries located in the
$HOME/.appmap
(Linux/macOS) or%HOME%/.appmap
(Windows) directory. This can lead to unnecessary storage usage as multiple old versions accumulate over time. The goal is to remove all older versions of the binaries and ensure that only the most recent version is retained moving forward.Analysis
To resolve this issue, we need to implement a cleanup function that scans the AppMap binaries directory and deletes all but the most recent binary. The most recent binary can be determined by the semver version number in the file name.
Furthermore, we should integrate this cleanup function to be automatically executed whenever a new AppMap binary is downloaded or installed. This ensures that the directory is consistently maintained with only the latest version, preventing storage bloat.