Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
branches:
- main
env:
NU_VERSION: 0.106.0
BASH_ENV_JSON_VERSION: 0.10.1
NU_VERSION: 0.116.1
BASH_ENV_JSON_VERSION: 0.11.0

jobs:
test:
Expand All @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4
- name: Download Nushell $NU_VERSION
run: |
curl -L https://github.com/nushell/nushell/releases/download/${NU_VERSION}/nu-${NU_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar xzf -
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: |
export PATH=./nu-${NU_VERSION}-x86_64-unknown-linux-gnu:$PATH
Expand All @@ -28,11 +28,12 @@ jobs:
jq --version
- name: Download bash-env-json $BASH_ENV_JSON_VERSION
run: |
curl -L https://github.com/tesujimath/bash-env-json/archive/refs/tags/${BASH_ENV_JSON_VERSION}.tar.gz | tar xzf -
curl -L "https://github.com/tesujimath/bash-env-json/archive/refs/tags/${BASH_ENV_JSON_VERSION}.tar.gz" | tar xzf -
- name: Run Module Tests
run: |
# note that Nushell doesn't like relative paths on the $PATH
export PATH=$(pwd)/bash-env-json-${BASH_ENV_JSON_VERSION}:./nu-${NU_VERSION}-x86_64-unknown-linux-gnu:$PATH
PATH="$(pwd)/bash-env-json-${BASH_ENV_JSON_VERSION}:./nu-${NU_VERSION}-x86_64-unknown-linux-gnu:$PATH"
export PATH
which bash-env-json
nu --no-config-file --no-history -c "use bash-env.nu ; use tests.nu run_bash_env_tests ; run_bash_env_tests"
nu --no-config-file --no-history -c "use bash-env.nu ; use extra-module-tests.nu ; extra-module-tests"
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ b

Rather than folding shell variables in with the environment variables as was done by the plugin, the `-s` or `--shellvars` option results in structured output with separate `env` and `shellvars`.

The `--export` option is deprecated. It returns a flat record containing environment changes merged with selected shell variables. To retrieve selected shell variables with `--shellvars`, select them from the nested `shellvars` record:

```nu
(bash-env ./environment.sh --shellvars).shellvars | select A
```

If you also need the environment changes returned by `--export [A]`, merge the records:

```nu
let changes = bash-env ./environment.sh --shellvars
$changes.env | merge ($changes.shellvars | select --optional A)
```

```
> echo "ABC=123" | bash-env
╭──────────────╮
Expand Down
2 changes: 1 addition & 1 deletion extra-module-tests.nu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std assert
use std/assert

# TODO use testing.nu testing module,
# which wasn't working at the time I wrote these tests
Expand Down
48 changes: 7 additions & 41 deletions flake.lock

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

2 changes: 1 addition & 1 deletion tests.nu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std assert
use std/assert

# TODO use testing.nu testing module,
# which wasn't working at the time I wrote these tests
Expand Down
Loading