bbin icon indicating copy to clipboard operation
bbin copied to clipboard

Consider keeping metadata and scripts separate

Open borkdude opened this issue 3 years ago • 2 comments

Splitting the metadata has the following benefits:

  • You can re-install scripts, even if the bin dir is wiped
  • You only have to back up those .edn files and can put them into source control
  • It feels less magic than having inline comments in scripts
  • Makes more sense with XDG conventions of keeping data and config separate

borkdude avatar Sep 23 '22 13:09 borkdude

Picking up where we left off on https://github.com/babashka/bbin/issues/62#issuecomment-1751995807:

I think there are pros/cons with both approaches. That said, it will be a bit before I change anything here because I want to focus on more user-facing features such as https://github.com/babashka/bbin/issues/33, https://github.com/babashka/bbin/issues/18, and https://github.com/babashka/bbin/issues/69. Let's keep talking about the tradeoffs in the mean time.

rads avatar Oct 08 '23 16:10 rads

My thoughts on how to store bbin script metadata (copied from https://github.com/babashka/bbin/issues/62#issuecomment-1751995807, edited for brevity):

I think @borkdude's proposal of having one EDN file per installed script and an operation in bbin to install a script for each EDN file is a good solution.

Why: because implementation complexity and User can track EDN files in Git, and have bbin ensure the scripts are installed on all computers are important, and bbin uninstall safety/atomicity can still be solved in the future.


I mapped this out with a Rich Hickey style decision matrix (as advocated for in Design in Practice). Screenshot:

image

Full document: https://docs.google.com/spreadsheets/d/1AWiYHYteuTtTGCaHWg0DNuX2rTXXJTzZzl0pbOzFsWU/edit#gid=0

(send me a Google account if you want write access, eg to add a new column for a different approach, or to add a new row for a different criterium).

I think "metadata by script install name" is the best place to start, then consider "metadata in transaction log" or "metadata by script hexdigest" later if safe/atomic uninstall is desired.

teodorlu avatar Oct 09 '23 11:10 teodorlu