mise icon indicating copy to clipboard operation
mise copied to clipboard

script tasks are not runnable when not having a project root config file

Open namjul opened this issue 1 year ago • 3 comments

Describe the bug

I created tasks in the form of .rtx/tasks/:taskname but when I run rtx tasks they would not show up as options. rtx run taskname would also not work.

After some debugging i find that they do show up and work when i have any of the following files at the root:

.rtx.dev.toml .rtx.local.toml .rtx.toml .tool-versions

Also i had a .rtx/config.toml which did not make it work. But its containing task would show up, just not script tasks.

To Reproduce

  1. create a new folder
  2. create a script tasks .rtx/tasks/:taskname
  3. run rtx t. (it will show an empty list of tasks)

Expected behavior

Should not show an empty list

namjul avatar Jan 03 '24 10:01 namjul

want to mention. thank you for building this tool. i very much enjoy it.

namjul avatar Jan 03 '24 11:01 namjul

I just ran into this problem. I'm sure this would be trivial to reproduce in a test but wanted to demonstrate the problem:

rsyring@meld:~/projects/kilo-src$ mise tasks --verbose
[DEBUG] ARGS: /usr/bin/mise tasks --verbose
[DEBUG] Config {
    Config Files: [
        "~/projects/kilo-src/.mise.toml",
        "~/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
Name          Description Source                                      
reqs-compile              ~/projects/kilo-src/.mise/tasks/reqs-compile
rsyring@meld:~/projects/kilo-src$ mv .mise.toml .mise/config.toml
rsyring@meld:~/projects/kilo-src$ mise tasks --verbose
[DEBUG] ARGS: /usr/bin/mise tasks --verbose
[DEBUG] Config {
    Config Files: [
        "~/projects/kilo-src/.mise/config.toml",
        "~/.mise.toml",
        "~/.config/mise/config.toml",
    ],
}
Name  Description Source

rsyring@meld:~/projects/kilo-src$ mise task edit foobar
mise failed read_to_string: ~/projects/kilo-src/.mise/.mise/tasks/foobar
mise No such file or directory (os error 2)
mise Run with --verbose or MISE_VERBOSE=1 for more information

Note that ".mise/.mise" is in the path to the file being edited.

rsyring avatar Jan 14 '24 02:01 rsyring

I believe this has been fixed by #1482

Ajpantuso avatar Jan 21 '24 16:01 Ajpantuso

yes this works now.

namjul avatar Feb 08 '24 14:02 namjul