Skip to content

Commit

Permalink
chore: fix cli assets
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 4, 2024
1 parent 455c04a commit ab8c6a0
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .codacy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
exclude_paths:
- "tasks/fig/generators.ts"
- "cli/assets/fig/generators.ts"
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include = [
"/Cargo.lock",
"/README.md",
"/src/**/*.rs",
"/assets/**/*",
]

[[bin]]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cli/src/cli/generate/fig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl Fig {
}

fn get_prescript() -> String {
include_str!("../../../../tasks/fig/generators.ts").to_string()
include_str!("../../../assets/fig/generators.ts").to_string()
}

fn get_postscript() -> String {
Expand Down
8 changes: 4 additions & 4 deletions cli/src/usage_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ use miette::Result;
pub(crate) fn generate() -> Result<()> {
let mut cli = Cli::command().version(env!("CARGO_PKG_VERSION"));
clap_usage::generate(&mut cli, "usage", &mut std::io::stdout());
println!("{}", include_str!("../usage-extra.usage.kdl").trim());
println!("{}", include_str!("../assets/usage-extra.usage.kdl").trim());

Ok(())
}

pub(crate) fn complete(shell: &str) -> Result<()> {
match shell {
"bash" => print!("{}", include_str!("../completions/usage.bash")),
"fish" => print!("{}", include_str!("../completions/usage.fish")),
"zsh" => print!("{}", include_str!("../completions/_usage")),
"bash" => print!("{}", include_str!("../assets/completions/usage.bash")),
"fish" => print!("{}", include_str!("../assets/completions/usage.fish")),
"zsh" => print!("{}", include_str!("../assets/completions/_usage")),
_ => unimplemented!("unsupported shell: {}", shell),
};

Expand Down
6 changes: 3 additions & 3 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ depends = ['build']
run = [
'usage --usage-spec > cli/usage.usage.kdl',
'usage g md -f cli/usage.usage.kdl --out-file docs/cli/reference.md',
'usage g completion bash usage --usage-cmd "usage --usage-spec" > cli/completions/usage.bash',
'usage g completion fish usage --usage-cmd "usage --usage-spec" > cli/completions/usage.fish',
'usage g completion zsh usage --usage-cmd "usage --usage-spec" > cli/completions/_usage',
'usage g completion bash usage --usage-cmd "usage --usage-spec" > cli/assets/completions/usage.bash',
'usage g completion fish usage --usage-cmd "usage --usage-spec" > cli/assets/completions/usage.fish',
'usage g completion zsh usage --usage-cmd "usage --usage-spec" > cli/assets/completions/_usage',
]

[tasks."render:example-md"]
Expand Down

0 comments on commit ab8c6a0

Please sign in to comment.