From ab8c6a0a14af1d4ec829660183ec58605afa33c7 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:55:34 -0600 Subject: [PATCH] chore: fix cli assets --- .codacy.yml | 2 +- cli/Cargo.toml | 1 + cli/{ => assets}/completions/_usage | 0 cli/{ => assets}/completions/usage.bash | 0 cli/{ => assets}/completions/usage.fish | 0 {tasks => cli/assets}/fig/generators.ts | 0 cli/{ => assets}/usage-extra.usage.kdl | 0 cli/src/cli/generate/fig.rs | 2 +- cli/src/usage_spec.rs | 8 ++++---- mise.toml | 6 +++--- 10 files changed, 10 insertions(+), 9 deletions(-) rename cli/{ => assets}/completions/_usage (100%) rename cli/{ => assets}/completions/usage.bash (100%) rename cli/{ => assets}/completions/usage.fish (100%) rename {tasks => cli/assets}/fig/generators.ts (100%) rename cli/{ => assets}/usage-extra.usage.kdl (100%) diff --git a/.codacy.yml b/.codacy.yml index 52a0697..452cf35 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -1,3 +1,3 @@ --- exclude_paths: - - "tasks/fig/generators.ts" + - "cli/assets/fig/generators.ts" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0ecf728..e840a21 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -13,6 +13,7 @@ include = [ "/Cargo.lock", "/README.md", "/src/**/*.rs", + "/assets/**/*", ] [[bin]] diff --git a/cli/completions/_usage b/cli/assets/completions/_usage similarity index 100% rename from cli/completions/_usage rename to cli/assets/completions/_usage diff --git a/cli/completions/usage.bash b/cli/assets/completions/usage.bash similarity index 100% rename from cli/completions/usage.bash rename to cli/assets/completions/usage.bash diff --git a/cli/completions/usage.fish b/cli/assets/completions/usage.fish similarity index 100% rename from cli/completions/usage.fish rename to cli/assets/completions/usage.fish diff --git a/tasks/fig/generators.ts b/cli/assets/fig/generators.ts similarity index 100% rename from tasks/fig/generators.ts rename to cli/assets/fig/generators.ts diff --git a/cli/usage-extra.usage.kdl b/cli/assets/usage-extra.usage.kdl similarity index 100% rename from cli/usage-extra.usage.kdl rename to cli/assets/usage-extra.usage.kdl diff --git a/cli/src/cli/generate/fig.rs b/cli/src/cli/generate/fig.rs index 058dd4e..238f8d1 100644 --- a/cli/src/cli/generate/fig.rs +++ b/cli/src/cli/generate/fig.rs @@ -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 { diff --git a/cli/src/usage_spec.rs b/cli/src/usage_spec.rs index 4a464b6..a1f8dda 100644 --- a/cli/src/usage_spec.rs +++ b/cli/src/usage_spec.rs @@ -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), }; diff --git a/mise.toml b/mise.toml index 87862e5..888e0b4 100644 --- a/mise.toml +++ b/mise.toml @@ -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"]