Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Release core functionality as library #7

Open
aimerib opened this issue Nov 23, 2022 · 2 comments
Open

Feature Request - Release core functionality as library #7

aimerib opened this issue Nov 23, 2022 · 2 comments

Comments

@aimerib
Copy link

aimerib commented Nov 23, 2022

This project is immensely helpful on its own, thank you guys!

However, the tool I'm currently writing is going to need to rely on terraform being installed, and instead of adding a wrapper around hcdl to manage that, I would love to be able to just import the core functionality of this tool as a library to manage HC's tools.

The way this CLI looks written, it seems like the actual binary part could be consisted of the code in the cli.rs file, plus main.rs and everything else can reside in a library, with the main.rs file importing the relevant functions.

If this is something you are willing to entertain, I could open a draft PR to showcase it, but I'm happy to leave this as just an idea.

Again, thank you for this tool!!

@phyber
Copy link
Collaborator

phyber commented Jun 26, 2023

Hi,

Apologies for taking a while to notice this issue. I’ve started moving various functionality under lib.rs within this crate as a first step on this issue.

Currently, the documentation needs a lot of work, and I’d like to move to items under lib.rs using thiserror instead of anyhow.

I’m also attempting to ensure that nothing covered by the library code performs any stdout/stderr output. Currently the HTTP Client still does some of this, due to the ProgressBar.

There’s a draft PR open for the current work on this in #8.

@phyber
Copy link
Collaborator

phyber commented Oct 10, 2023

I’ve merged my progress here, sorry it’s taking so long. I’d say it’s still very incomplete, mostly due to the Client::download function still producing a progress bar. This can be prevented by setting quiet mode in the client config, but it’s not the cleanest. I probably want to break the client and lib out into their own workspaces too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants