Update README.md for background tasks (#826)

This commit is contained in:
Rayan Amal 2024-04-29 00:07:57 +03:00 committed by GitHub
parent 660b55c2f0
commit 5782e2b5d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,7 @@ with-env { FOO: ($foo | to json) } {
}
```
## How can I reuse custom commands in a background task?
### How can I reuse custom commands in a background task?
You can define these commands in a seperate module, like so:
@ -63,3 +63,6 @@ task spawn {
foo bar
}
```
## Troubleshooting
- On some setups (e.g. NixOS with `nu` installed as a binary in user's `$HOME`), `sh` (which `pueue` delegates tasks to run) might fail to find `nu` in the `$PATH`. In this case hard-coding the location of your nu binary in the `task spawn` function definiton in `task.nu` can solve the issue.