Ability to specify a non standard bb.edn file path #869
Replies: 9 comments 20 replies
-
My initial response is: just write a bash wrapper script that cds into the right directory and then calls bb? But perhaps I'm missing something. |
Beta Was this translation helpful? Give feedback.
-
BTW, the first proposal is a (possible) breaking change, and while it is more user friendly I think it looks kinda magic. I prefer the second proposal of a explicitly flag setting the context. I really liked the |
Beta Was this translation helpful? Give feedback.
-
Some new insight, while I was working on nbb (https://github.com/borkdude/nbb). It seems that in the Node.js ecosystem, the file location from the script is somehow also playing a role in dependency resolution: the relative I don't think the clojure CLI does this. |
Beta Was this translation helpful? Give feedback.
-
In order to support both the ability to run tasks from different locations and to be able to maintain multiple configuration files ( like admin-tasks.edn and dev-tasks.edn ), I think we need the ability to specify the following independently:
The configuration file could also specify internally the project-root as a key/val. So, if I have an admin-tasks.edn in the project root - I could run it from anywhere with the --conf option. The project root would be the location of the admin-tasks.edn file. I could do things on files on PWD or use the (project-root) Would that make sense? |
Beta Was this translation helpful? Give feedback.
-
Just to add on to this discussion, I attempted to do something similar here: https://clojureverse.org/t/help-utilizing-babashka-tasks-globally/8026. The result was having to cd into the directory housing |
Beta Was this translation helpful? Give feedback.
-
I think we could make bb:
So given:
this invocation
will use What are some things that can break if we introduce this behavior? |
Beta Was this translation helpful? Give feedback.
-
We could also make an API to define tasks in a standalone script
How would one use this if it was possible? |
Beta Was this translation helpful? Give feedback.
-
node behaves like this:
|
Beta Was this translation helpful? Give feedback.
-
Any update on this topic? How about referring to I need this global |
Beta Was this translation helpful? Give feedback.
-
Context
Currently for using a
bb.edn
file, the canonical location for it is the same PWD where we are launching thebb
command. This works out well as the paths referred in it are all relative to the location of it.Issue
For any case bb needs to be invoked from any other location, its not straightforward to specify the location of bb.edn and also execute the script(s) relative to it.
Proposal 1
We model it like docker in which we can specify a path for a non standard location of the
Dockefile
via-f
and it takes the context path. All the referrals in the Dockerfile are relative to the context path not the Dockerfile path.We could introduce
--bb-edn
opt to specify the path, defaulting to.
and--context
or--project-root
or something similar to specify the context. The defaults to.
too. All the paths in thebb.edn
are relative to this.Beta Was this translation helpful? Give feedback.
All reactions