Skip to content

Commit

Permalink
feat: add nushell
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 3, 2024
1 parent 1b8c64c commit 3e08905
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
plugin: .
args: |
fish echo "Hello, world!"
nu which nu
working-directory: example
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -38,7 +39,7 @@ use fluentci_pdk::dag;

// ...

dag().call("https://pkg.fluentci.io/[email protected].0?wasm=1", "bash", vec!["echo 'Hello, World!'"])?;
dag().call("https://pkg.fluentci.io/[email protected].1?wasm=1", "bash", vec!["echo 'Hello, World!'"])?;
```

## 📚 Examples
Expand Down
14 changes: 7 additions & 7 deletions fluentci.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "shell-plugin"
version = "0.1.0"
authors = [
"Tsiry Sandratraina <[email protected]>",
]
description = "Shell plugin for FluentCI"
license = "MIT"
keywords = [
"shell"
"shell",
]
authors = [
"Tsiry Sandratraina <[email protected]>"
]
license = "MIT"
name = "shell-plugin"
version = "0.1.1"
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@ pub fn zsh(args: String) -> FnResult<String> {
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn nu(args: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec![
"pkgx",
"+nushell.sh",
"nu",
"-c",
&format!("'{}'", args),
])?
.stdout()?;
Ok(stdout)
}

0 comments on commit 3e08905

Please sign in to comment.