mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
.. [no ci]
This commit is contained in:
parent
bac1ee27fc
commit
96660cbab4
2 changed files with 7 additions and 2 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -35,6 +35,8 @@ jobs:
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
YAZI_GEN_COMPLETIONS: true
|
||||||
run: cargo build --release --locked --target ${{ matrix.target }}
|
run: cargo build --release --locked --target ${{ matrix.target }}
|
||||||
|
|
||||||
- name: Pack artifacts [Linux & macOS]
|
- name: Pack artifacts [Linux & macOS]
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
#[path = "src/boot/cli.rs"]
|
#[path = "src/boot/cli.rs"]
|
||||||
mod cli;
|
mod cli;
|
||||||
|
|
||||||
use std::{fs, io};
|
use std::{env, fs, io};
|
||||||
|
|
||||||
use clap::CommandFactory;
|
use clap::CommandFactory;
|
||||||
use clap_complete::{generate_to, Shell};
|
use clap_complete::{generate_to, Shell};
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
|
if env::var_os("YAZI_GEN_COMPLETIONS").is_none() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let cmd = &mut cli::Args::command();
|
let cmd = &mut cli::Args::command();
|
||||||
let bin = "yazi";
|
let bin = "yazi";
|
||||||
let out = "completions";
|
let out = "completions";
|
||||||
|
|
@ -19,6 +23,5 @@ fn main() -> io::Result<()> {
|
||||||
generate_to(Shell::PowerShell, cmd, bin, out)?;
|
generate_to(Shell::PowerShell, cmd, bin, out)?;
|
||||||
generate_to(clap_complete_nushell::Nushell, cmd, bin, out)?;
|
generate_to(clap_complete_nushell::Nushell, cmd, bin, out)?;
|
||||||
generate_to(clap_complete_fig::Fig, cmd, bin, out)?;
|
generate_to(clap_complete_fig::Fig, cmd, bin, out)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue