Skip to content

Commit

Permalink
doc: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisGorbachev committed Jul 17, 2024
1 parent 858fc01 commit aa6f3d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ Options:
Print help
```

## Additional binaries

* `create-rust-github-private-bin`
* `create-rust-github-private-lib`
* `create-rust-github-public-bin`
* `create-rust-github-public-lib`

## License

[Apache License 2.0](LICENSE-APACHE) or [MIT License](LICENSE-MIT) at your option.
Expand Down
6 changes: 6 additions & 0 deletions README.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ const $ = zx.$({
})

const parse = (input: { toString: () => string }) => JSON.parse(input.toString())
const renderMarkdownList = (items: string[]) => items.map(bin => `* ${bin}`).join('\n')

const theCargoToml: CargoToml = parse(await $`yj -t < Cargo.toml`)
const name = theCargoToml.package.name
const bin = name
const description = theCargoToml.package.description
const help = await $`cargo run --quiet --bin ${bin} -- --help`
const repo: Repo = parse(await $`gh repo view --json url`)
const extraBins = (await $`find src/bin/*.rs -type f -exec basename {} .rs \\;`).valueOf().split("\n")

const autogenerated = `
<!-- DO NOT EDIT -->
Expand Down Expand Up @@ -81,6 +83,10 @@ cargo install ${name}
${help.stdout.trim()}
\`\`\`
## Additional binaries
${renderMarkdownList(extraBins.map(bin => `\`${bin}\``))}
## License
[Apache License 2.0](LICENSE-APACHE) or [MIT License](LICENSE-MIT) at your option.
Expand Down

0 comments on commit aa6f3d8

Please sign in to comment.