Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hooks.md #1749

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Update hooks.md #1749

merged 1 commit into from
Jan 16, 2025

Conversation

schlich
Copy link
Contributor

@schlich schlich commented Jan 16, 2025

Running the example for environment activation as-is gave the following type mismatch error:

Error: nu::shell::type_mismatch

  × Type mismatch during operation.
    ╭─[/Users/foo/Library/Application Support/nushell/config.nu:27:33]
 26 │                         ('/Users/foo/dir' not-in $after
 27 │                             and '/Users/foo/dir' in $before
    ·                                 ─────────────────────┬──────────────────── ─┬ ───┬───
    ·                                                      │                      │    ╰── nothing
    ·                                                      │                      ╰── type mismatch for operator
    ·                                                      ╰── string
 28 │                             and 'activate' in (overlay list))
    ╰────


~ 
❯ 𝒾: 
process finished with exit code = -1

```
Error: nu::shell::type_mismatch

  × Type mismatch during operation.
    ╭─[/Users/foo/Library/Application Support/nushell/config.nu:27:33]
 26 │                         ('/Users/foo/dir' not-in $after
 27 │                             and '/Users/foo/dir' in $before
    ·                                 ─────────────────────┬──────────────────── ─┬ ───┬───
    ·                                                      │                      │    ╰── nothing
    ·                                                      │                      ╰── type mismatch for operator
    ·                                                      ╰── string
 28 │                             and 'activate' in (overlay list))
    ╰────


~ 
❯ 𝒾: 
process finished with exit code = -1
```
@fdncred
Copy link
Collaborator

fdncred commented Jan 16, 2025

This looks right to me because on startup before is null. I rely on that in one env change hook so that the hook only runs at startup. Thanks!

@fdncred fdncred merged commit b6e9dd3 into nushell:main Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants