A CLI tool to migrate a legacy coursier cache, under ~/.coursier/cache,
to the newer OS-dependent location:
~/.cache/coursieron Linux,~/Library/Caches/Coursieron macOS,C:\Users\_UserName_\AppData\Local\Coursier\Cachein most cases on Windows (replace_UserName_by your user name - for example, user nameAlexgivesC:\Users\Alex\AppData\Local\Coursier\Cache).
Run a dry run with
$ cs launch --contrib cache-migration -- --dry-runReally run it with
$ cs launch --contrib cache-migrationOptionally, pass --clean-up to remove ~/.coursier/cache, if it's empty
after the migration
$ cs launch --contrib cache-migration -- --clean-upIf both the legacy and the newer cache directories exist on your system, a message will invite you to pass some extra options. As of writing this, these options are:
--one-by-one(individually moving files from the legacy cache to the newer one) and--clean-up(removing empty directories from the legacy cache, and the legacy cache itself if it ends up being empty).
You should then run cache-migration like
$ cs launch --contrib cache-migration -- --one-by-one --clean-upCreate a launcher for cache-migration with
cs bootstrap --standalone --contrib cache-migration -o cache-migrationThis creates two files in the current directory:
cache-migration, which is a JAR for cache-migration, andcache-migration.bat, which launchescache-migration.
Then follow the Linux and macOS instructions above, replacing cs launch --contrib cache-migration -- with .\cache-migration, like
.\cache-migration --dry-run.\cache-migration.\cache-migration --clean-up.\cache-migration --one-by-one --clean-up