Skip to content

Commit

Permalink
Switch to native Rust for nu_protocol handling (#26)
Browse files Browse the repository at this point in the history
Tracking changes in the Nu plugin protocol by hand was too onerous.

This is a major change so that the plugin is now native Rust, and spawns the Bash script as a subprocess.

Fixes #25
  • Loading branch information
tesujimath authored Aug 22, 2024
1 parent a44b38d commit 3b7de8b
Show file tree
Hide file tree
Showing 16 changed files with 1,233 additions and 1,018 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: test suite
on: [push, pull_request]
env:
NU_VERSION: 0.96.1
NU_VERSION: 0.97.1

jobs:
test:
Expand All @@ -15,10 +15,16 @@ jobs:
curl -L https://github.com/nushell/nushell/releases/download/${NU_VERSION}/nu-${NU_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
- name: Version Check
run: |
./nu-${NU_VERSION}-x86_64-unknown-linux-gnu/nu --version
export PATH=./nu-${NU_VERSION}-x86_64-unknown-linux-gnu:$PATH
nu --version
bash --version
jq --version
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build
- name: Run Tests
run: |
./nu-${NU_VERSION}-x86_64-unknown-linux-gnu/nu --no-config-file --no-history -c "plugin add --plugin-config plugin.msgpackz nu_plugin_bash_env"
./nu-${NU_VERSION}-x86_64-unknown-linux-gnu/nu --no-config-file --no-history -c "plugin use --plugin-config plugin.msgpackz bash_env ; use tests.nu run_bash_env_tests ; run_bash_env_tests"
export PATH=./nu-${NU_VERSION}-x86_64-unknown-linux-gnu:$PATH
nu --no-config-file --no-history -c "plugin add --plugin-config plugin.msgpackz target/debug/nu_plugin_bash_env"
nu --no-config-file --no-history -c "plugin use --plugin-config plugin.msgpackz bash_env ; use tests.nu run_bash_env_tests ; run_bash_env_tests"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target/
/.direnv/
/result
plugin.msgpackz
Loading

0 comments on commit 3b7de8b

Please sign in to comment.