`devenv tasks run` enter the shell even when run from devenv shell
Describe the bug
When running:
devenv tasks run my-task
The command reload the devenv shell even if called from an active shell.
Please add a condition to prevent this.
En aparté, It might be interesting to add initShell in addition to enterShell:
-
initShellwould run tasks required to initialize any devenv shell (setting PATH, ...) -
enterShellwould run tasks needed when entering an interactive shell (starting services, starship, ...).
Version
devenv 1.8.1 (x86_64-linux)
I'm confused what's going on here, besides you can't name a task my-task, it needs a prefix. Can you include task definition in form of devenv.nix?
This isn't a task name issue. It an issue with devenv tasks run that reload the devenv (it runs devenv shell) before running the task, even if the devenv is already loaded.
$ devenv task run 'ci:lint'
• Using Cachix caches: devenv
✓ Building shell in 79.0ms
FYI: I've created a taskfile module for my tasks, feel free to take a look (https://github.com/biapy/devenv-go-task)
Oh I've seen this before, someone on Discord was saying that adding one environment variable makes eval cache work. I'll need to dig up which one it was.
https://discord.com/channels/1036369714731036712/1036369758024650792/1436439286579990722 looks like it's DEVENV_STATE.
See https://github.com/cachix/devenv/pull/2297, needs testing.
This isn't a task name issue. It an issue with
devenv tasks runthat reload the devenv (it runsdevenv shell) before running the task, even if the devenv is already loaded.$ devenv task run 'ci:lint' • Using Cachix caches: devenv ✓ Building shell in 79.0ms FYI: I've created a taskfile module for my tasks, feel free to take a look (https://github.com/biapy/devenv-go-task)
It looks like it's using cached version of shell, it loads in 80ms so that works as expected.