From 3e08905f9098a698af423d27615c44b8caa57aec Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sat, 3 Aug 2024 19:03:26 +0000 Subject: [PATCH] feat: add nushell --- .github/workflows/ci.yml | 1 + Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 3 ++- fluentci.toml | 14 +++++++------- src/lib.rs | 15 +++++++++++++++ 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a604b84..fa06d3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: plugin: . args: | fish echo "Hello, world!" + nu which nu working-directory: example env: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 02e4411..406d646 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "shell" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "extism-pdk", diff --git a/Cargo.toml b/Cargo.toml index 03225ba..bf77e0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ description = "Set up your CI/CD Pipeline with a specific version of Cue" edition = "2021" license = "MIT" name = "shell" -version = "0.1.0" +version = "0.1.1" [lib] crate-type = [ diff --git a/README.md b/README.md index aafc6fc..1f57d3e 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ fluentci run --wasm shell fish echo "Hello, World!" | bash | Run bash commands | | fish | Run fish commands | | zsh | Run zsh commands | +| nu | Run nushell commands | ## Code Usage @@ -38,7 +39,7 @@ use fluentci_pdk::dag; // ... -dag().call("https://pkg.fluentci.io/shell@v0.1.0?wasm=1", "bash", vec!["echo 'Hello, World!'"])?; +dag().call("https://pkg.fluentci.io/shell@v0.1.1?wasm=1", "bash", vec!["echo 'Hello, World!'"])?; ``` ## 📚 Examples diff --git a/fluentci.toml b/fluentci.toml index 34e0a86..573f84d 100644 --- a/fluentci.toml +++ b/fluentci.toml @@ -1,11 +1,11 @@ [package] -name = "shell-plugin" -version = "0.1.0" +authors = [ + "Tsiry Sandratraina ", +] description = "Shell plugin for FluentCI" -license = "MIT" keywords = [ - "shell" + "shell", ] -authors = [ - "Tsiry Sandratraina " -] \ No newline at end of file +license = "MIT" +name = "shell-plugin" +version = "0.1.1" diff --git a/src/lib.rs b/src/lib.rs index d1e6c78..2dc720b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,3 +27,18 @@ pub fn zsh(args: String) -> FnResult { .stdout()?; Ok(stdout) } + +#[plugin_fn] +pub fn nu(args: String) -> FnResult { + let stdout = dag() + .pkgx()? + .with_exec(vec![ + "pkgx", + "+nushell.sh", + "nu", + "-c", + &format!("'{}'", args), + ])? + .stdout()?; + Ok(stdout) +}