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

Workspace usage error #60

Open
emilk opened this issue Jan 17, 2021 · 2 comments
Open

Workspace usage error #60

emilk opened this issue Jan 17, 2021 · 2 comments

Comments

@emilk
Copy link

emilk commented Jan 17, 2021

When I try to use cargo readme in a workspace directory I get this error:

Error: missing field path for key lib at line 23 column 1

I have a workspace with many crates in it, and I'd like to generate individual README.mds for each one. I've tried both:

  • cargo readme -r subcrate > subcrate/README.md
  • (cd subcrate ; cargo readme > README.md)

With the same error message.

This is the workspace: https://github.com/emilk/egui/

@emilk emilk changed the title Workspace report Workspace usage error Jan 17, 2021
@jedbrown
Copy link

I encountered this same error message when I had a [lib] section that did not contain an explicit path = "src/lib.rs". Removing the entire [lib] section or adding path both circumvented this error.

@iagox86
Copy link

iagox86 commented Sep 29, 2021

I ran into the same issue.. I used a pre-commit hook to fix it with this code:

# Get the root directory
BASE=$(git rev-parse --show-toplevel)

# Update README.md
pushd $BASE/h2gb > /dev/null

# Do the main README.md
cargo readme -o $BASE/README.md

But it would be nice if it could cleanly handle workspaces!

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

3 participants