augustocdias / vscode-shell-command

A task helper to use system commands as input
MIT License
55 stars 20 forks source link

custom values aren't returned #113

Closed obambrough closed 1 month ago

obambrough commented 1 month ago

Extension version: 1.12.2 VS Code version: 1.93.1 (Universal)

When an input is configured to allow custom values, the user entered custom value isn't returned.

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "SelectRepo",
      "command": "echo ${input:SelectRepository}",
      "type": "shell"
    }
  ],
  "inputs": [
    {
      "id": "SelectRepository",
      "type": "command",
      "command": "shellCommand.execute",
      "args": {
        "command": "docker image ls --format '{{.Repository}}' | sort | uniq",
        "allowCustomValues": true
      }
    }
  ]
}

Expected behavior

When the 'SelectRepo' task is run and I enter a custom value (e.g. apache) it should print “echo apache”

Actual behavior

When the 'SelectRepo' task is run and I enter a custom value (e.g. apache) it doesn’t print the custom value, it prints “echo”

Note: If I do use a value from the drop-down, not a custom value, it works correctly printing “echo nginx”

MarcelRobitaille commented 1 month ago

Thanks for the report. I can reproduce it. I think you have a mistake here though: ${input: SelectRepository}. There should be no space.

MarcelRobitaille commented 1 month ago

@obambrough should be fixed in 1.12.3. Please try it.

obambrough commented 1 month ago

Awesome, 1.12.3 fixed it. You're right, I somehow added a space in my example task definition that wasn't in my actual tasks.json - I've updated the issue text to fix that.