a purposely simple aliasing tool
Well everything and nothing. Its just an aliasing tool, but can call any other build tool, etc.
Do.it does aliasing that is both based on an individual home alias config merged with a project specific alias config.
The idea here is to alias any bit of any cli call with basic string parsing so any command can be generated.
my-alias:
ls
my-clojure-alias
clojure -M:dev
do ^my-alias
=> ls
do ^my-alias -lash
=> ls -lash
do ^my-clojure-alias:repl
=> clojure -M:dev:repl
By default the load in this order, with the last loaded taking priority.
- Home aliases
- Project aliases
- Home aliases marked with
^override
- Project aliases marked with
^override
When called with do -me ^my-alias
it will reverse the priority of home vs project aliases
- Project aliases
- Home aliases
- Project aliases marked with
^override
- Home aliases marked with
^override
Im a lazy typer.
deps.edn set up can lead to long commands that also need particular appending per environment. This is of course user preference on how the aliases are set up. In my team we have many devs using many set ups. If we were to use Makefile, for example, there would be a huge permutation of commands like clojure -M:dev:vscode
, clojure -M:dev:emacs
, clojure -M:dev:test:vscode
, clojure -M:dev:test:emacs
, etc depending on the task, environment, and dev preference. Something like Makefile would need a long list of combinations to cover them all.
Using homebrew
brew tap sirmspencer/tap
brew install doit
Create do.it
(.do.it
also supported) in your home or local / project directory. Add a task.
mytask:
ls
Call with
doit ^mytask -lash
Show help
doit --help
List the combined set of tasks
doit --ls
Echo result instead of shelling it
doit --echo
- Not windows compatible
- Some path aliases need special treatment. For example
~/
gets replaced with the full path from system properties. Not sure how many others there are. - The local / project file is only read from current directory
- Add tests
- Read local from project root and not just current directory, if in a git project.
- Variables. sum like
^task:repl --param ^var1^=dev
- Windows compatible
There are other cli tools that help alot. Makefile, package.json, bashrc, etc. None of these solutions work well for certain clojure specific aliases. They don't include the same home -> project hierarchy you get from lein or deps.edn.