Allow setting sbotcli path using environment variable #1
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Check for the
SBOTCLI_PATH
env var: if it exists, use it when constructing commands to invokesbotcli
; if it does not exist, use a default path.We need to try and make this modular so that it plays nicely as a standalone library and when imported into
peach-web
.^^ sounds good.
As I mentioned in this comment
currently go-sbotcli determines where the working directory is
using the home directory of the user that invokes it, which is why in sbot_client I was running commands as peach-go-sbot.
Now that we have the assistance of @cblgh,
we should probably make a PR to go-sbot to allow setting the working directory using a CLI flag (or env var),
similar to your issue above, we could make it so this rust library allows for setting the working directory using an env var or CLI flag, which then gets passed along to go-sbot
After both of the above, we can then use this library directly from peach-web.
could also consider to do an object-oriented pattern, with something like:
this might be the most modular
not sure if it makes more sense for a rust library to be configured via env variables, or explicitly via instantiating an object with arguments, or both.
perhaps with an object is more modular, because a user of the library could always write their own thing which looks for env variables and then instantiates the object correctly,
but I would be curious to see what other rust libraries and API wrappers do
also for ergonomics, SbotcliApi object could just be called Sbot
+1 to this idea.
Good call! I had totally neglected to consider an object-oriented pattern. I'll take a look at implementing it and see how it feels to work with.
I tend to agree with you that configuration via object parameter is more practical in a library (offered greater flexibility for the library users).