nix-community / comma

Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
1.14k stars 50 forks source link

feat: cache choices #83

Closed diniamo closed 2 months ago

diniamo commented 3 months ago

I chose bitcode because it scored the highest on the https://github.com/djkoloski/rust_serialization_benchmark, and doesn't have any dependencies.

Rust makes me unsure about everything, so feel free to point anything out. The worst part is probably that there are 3 checks for whether the cache is available in main, but it's either that or some unreadable nesting.

I probably didn't test enough either, so I'd appreciate some help with that as well.

Closes #77 Closes #76 Partly completes #69

SuperSandro2000 commented 3 months ago

Should we add an option to ignore the cache for one command and update the result? This would be useful if you choose a wrong result for a command.

diniamo commented 3 months ago

The remove one already does that, since the program doesn't exit after the removal.

diniamo commented 3 months ago

I realized that the previous approach was complicated and annoying to use, for example, you would have had to type , -d hello hello to overwrite the cache entry for hello. Instead of 1, there are now 2 options, 1 for emptying the entire cache, and 1 for deleting the command from the cache before running the rest of the application logic.

diniamo commented 2 months ago

@Artturin not sure if you missed this, but I think most people would like to see this merged. Any chance you could take a look?

Artturin commented 2 months ago

Awesome, thank you.