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

Refactor: Config generation and Dependency Resolution #1736

Closed
wants to merge 3 commits into from

Conversation

harshdoesdev
Copy link
Contributor

Refactoring how config is generated and dependency packages are handled.

Discussion: https://github.com/FifthTry/business/discussions/308

@@ -60,6 +60,9 @@ async fn fastn_core_commands(matches: &clap::ArgMatches) -> fastn_core::Result<(
return fastn_core::create_package(name, path, download_base_url).await;
}

let current_dir: camino::Utf8PathBuf = std::env::current_dir()?.canonicalize()?.try_into()?;
let ds = fastn_ds::DocumentStore::new(current_dir);

let mut config = fastn_core::Config::read_current(true).await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use read_current if you have a handle to ds.

Comment on lines -83 to +86
fastn_update::update(&config, offline).await?;
fastn_update::update(&ds, offline).await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since config is not needed by fastn_update, we can re-order this function to not construct config before calling this.

@harshdoesdev
Copy link
Contributor Author

Closed in favour of #1751

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

Successfully merging this pull request may close these issues.

2 participants