babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
367 stars 27 forks source link

Suggestion: `neil dep local <lib> <path>` #182

Open rads opened 1 year ago

rads commented 1 year ago

Description: During local dev we use :local/root in the deps.edn file for libs we want to override.

Problem: Editing deps.edn manually when checking out a branch is tedious. Having a command for this in neil would enable automation (such as keybindings) to make this smoother.

Example:

$ cat deps.edn
{:deps {io.github.rads/deps-info {:git/url "https://github.com/rads/deps-info"
                                  :git/tag "v0.1.2"
                                  :git/sha "440af72"}}}

$ neil dep local deps-info ../deps-info
$ cat deps.edn
{:deps {io.github.rads/deps-info {:local/root "../deps-info"}
                                 #_{:git/url "https://github.com/rads/deps-info"
                                    :git/tag "v0.1.2"
                                    :git/sha "440af72"}}}

Questions:

borkdude commented 1 year ago

I think maybe we could do it like:

neil dep add <lib> --local

since we also have:

neil dep add <lib> --sha ...

The toggling idea is quite neat.

borkdude commented 1 year ago

Or rather: neil dep add lib --local/root path