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

Read README from flake's store path #81

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ async fn push_new_release(
.wrap_err("Writing compressed tarball to tempfile")?;

let release_metadata = ReleaseMetadata::build(
flake_root,
&source,
subdir,
revision_info,
flake_metadata,
Expand Down
8 changes: 4 additions & 4 deletions src/release_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl ReleaseMetadata {
// FIXME
#[allow(clippy::too_many_arguments)]
#[tracing::instrument(skip_all, fields(
flake_root = %flake_root.display(),
flake_store_path = %flake_store_path.display(),
subdir = %subdir.display(),
description = tracing::field::Empty,
readme_path = tracing::field::Empty,
Expand All @@ -100,7 +100,7 @@ impl ReleaseMetadata {
visibility = ?visibility,
))]
pub(crate) async fn build(
flake_root: &Path,
flake_store_path: &Path,
subdir: &Path,
revision_info: RevisionInfo,
flake_metadata: serde_json::Value,
Expand Down Expand Up @@ -140,7 +140,7 @@ impl ReleaseMetadata {
None
};

let readme_dir = flake_root.join(subdir);
let readme_dir = flake_store_path.join(subdir);
let readme = get_readme(readme_dir).await?;

let spdx_identifier = if spdx_expression.is_some() {
Expand Down Expand Up @@ -232,7 +232,7 @@ async fn get_readme(readme_dir: PathBuf) -> color_eyre::Result<Option<String>> {

while let Some(entry) = read_dir.next_entry().await? {
if entry.file_name().to_ascii_lowercase() == README_FILENAME_LOWERCASE {
return Ok(Some(tokio::fs::read_to_string(entry.file_name()).await?));
return Ok(Some(tokio::fs::read_to_string(entry.path()).await?));
}
}

Expand Down