This is going to be the equivalent of 2 devlogs since I thought I made one earlier for persists but I didn’t.
New feature! We now handle persist items in order to store data between versions. These are files which are persisted between versions of an app.
Lets take git as an example to explain why persist exists. Say you want to make sure your git config isn’t deleted every time you update. The issue with this is that the config file is saved in the version specfic directory.
To resolve this we can keep the config in $MOCHA_DIR/persist and then symlink the config to where it needs to be, which is essentially what persist tells us to do.
Since we handled persist items last time we can now implement mocha upgrade to update apps. The way scoop handles updates is by first removing anything that references the app, like shortcuts or shims.
Then we just follow the install process from scratch. This leaves the old version available in case a user wants to revert versions due to a bug, while also updating to the latest available version.
This can be seen in the video below, which shows me updating llama.cpp-hip-radeon.