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

Script tasks fail when dir includes templates #1469

Closed
cschmatzler opened this issue Jan 16, 2024 · 1 comment · Fixed by #1473 or #1477
Closed

Script tasks fail when dir includes templates #1469

cschmatzler opened this issue Jan 16, 2024 · 1 comment · Fixed by #1473 or #1477
Labels
bug Something isn't working
Milestone

Comments

@cschmatzler
Copy link

cschmatzler commented Jan 16, 2024

Describe the bug
Trying to set up a task that is more complex, so would like to use a script task.

This, inside .mise.toml works:

[tasks."as-toml"]
description = "This works"
run = "echo hi"
dir = "{{config_root}}/man"

This, in .mise/tasks/as-script, fails:

#!/usr/bin/env bash
# mise description="This will fail"
# mise dir="{{config_root}}/man"

echo hi

To Reproduce
Save the above script as a task and run it.

leuchtturm [!?]   main
❯ mr as-toml
[as-toml] $ echo hi
hi

leuchtturm [!?]   main
❯ mr as-script
[as-script] $ ~/dev/leuchtturm/.mise/tasks/as-script
mise failed to execute command: ~/dev/leuchtturm/.mise/tasks/as-script

Expected behavior
The script should run inside the man directory, not fail to execute.

mise doctor output

mise version:
  2024.1.21 macos-arm64 (2024-01-16)

build:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Tue, 16 Jan 2024 01:22:13 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21) (Homebrew)
  Profile: release

shell:
  fish
  fish, version 3.6.3-1333-g365027d55

mise data directory:
  /Users/christophschmatzler/.local/share/mise

mise environment variables:
  MISE_SHELL=fish

settings:
  {
    "activate_aggressive": false,
    "all_compile": false,
    "always_keep_download": false,
    "always_keep_install": false,
    "asdf_compat": false,
    "cargo_binstall": true,
    "color": true,
    "disable_default_shorthands": false,
    "disable_tools": [],
    "experimental": true,
    "jobs": 4,
    "legacy_version_file": true,
    "legacy_version_file_disable_tools": [],
    "node_compile": false,
    "not_found_auto_install": true,
    "paranoid": false,
    "plugin_autoupdate_last_check_duration": "7d",
    "python_compile": false,
    "python_default_packages_file": "/Users/christophschmatzler/.default-python-packages",
    "python_patch_url": null,
    "python_precompiled_os": null,
    "python_patches_directory": null,
    "python_precompiled_arch": null,
    "python_pyenv_repo": "https://github.com/pyenv/pyenv.git",
    "python_venv_auto_create": false,
    "raw": false,
    "shorthands_file": null,
    "task_output": null,
    "trusted_config_paths": [],
    "quiet": false,
    "verbose": false,
    "yes": false,
    "ci": false,
    "cd": null,
    "debug": false,
    "env_file": null,
    "trace": false,
    "log_level": "info"
  }

config files:
  ~/.config/mise/config.toml
  ~/dev/leuchtturm/.tool-versions
  ~/dev/leuchtturm/.mise.toml

plugins:
  argo        https://github.com/sudermanjr/asdf-argo.git#2ed321a
  awscli      https://github.com/MetricMike/asdf-awscli.git#7a1103e
  bun         (core)
  deno        (core)
  elixir      https://github.com/asdf-vm/asdf-elixir.git#588ee99
  erlang      https://github.com/asdf-vm/asdf-erlang.git#9c65998
  go          https://github.com/kennyp/asdf-golang.git#21d9c32
  helm        https://github.com/Antiarchitect/asdf-helm.git#a39e17b
  java        (core)
  jq          https://github.com/azmcode/asdf-jq.git#af8cad8
  k9s         https://github.com/looztra/asdf-k9s.git#04de6fa
  kubectl     https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  node        (core)
  pnpm        https://github.com/jonathanmorley/asdf-pnpm.git#ea033db
  python      (core)
  ruby        (core)
  rust        https://github.com/code-lever/asdf-rust.git#95acf4f
  stylua      https://github.com/jc00ke/asdf-stylua.git#d8c9762
  terraform   https://github.com/asdf-community/asdf-hashicorp.git#c44c314

toolset:
  rust@1.75.0, node@21.5.0

No problems found

Additional context
None!

@cschmatzler cschmatzler added the bug Something isn't working label Jan 16, 2024
jdx added a commit that referenced this issue Jan 16, 2024
jdx added a commit that referenced this issue Jan 16, 2024
jdx added a commit that referenced this issue Jan 16, 2024
@jdx jdx added this to the tasks v1 milestone Jan 17, 2024
@jdx jdx closed this as completed in #1473 Jan 17, 2024
jdx added a commit that referenced this issue Jan 17, 2024
@cschmatzler
Copy link
Author

Hey @jdx! Thanks for the quick PR. Unfortunately, this still fails for the example I have given, with a subdirectory.

# works
# mise dir="{{config_root}}"
# fails with mise failed to execute command: ~/dev/leuchtturm/.mise/tasks/man:deploy
# mise dir="{{config_root}}/man"
❯ mise --version
2024.1.22 macos-arm64 (9b81b2a 2024-01-17)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants