getappmap / vscode-appland

AppLand extension for VSCode
MIT License
138 stars 15 forks source link

Delete old AppMap binaries #1007

Open dustinbyrne opened 1 month ago

dustinbyrne commented 1 month ago

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.

kgilpin commented 2 days ago

We could do this with a CLI command.

Might be safer.