phing icon indicating copy to clipboard operation
phing copied to clipboard

InputTask does not wait user input via composer task scripts

Open dragomano opened this issue 1 year ago • 6 comments

Describe the bug My build has a simple input with InputTask:

<?xml version="1.0" encoding="UTF-8" ?>

<project name="Test" default="build">
  <target name="build">
    <input message="What is your release type?" propertyName="release.type" defaultValue="thesame" validargs="thesame,major,minor,bugfix" />
    <echo message="Release type: ${release.type}" />
  </target>
</project>

When I am running "vendor/bin/phing" via composer script - composer run build, user input does not work, it's skipped.

Steps To Reproduce Add "vendor/bin/phing" to composer scripts section:

{
  "require-dev": {
    "phing/phing": "3.*"
  },
  "minimum-stability": "alpha",
  "scripts": {
    "build": "vendor/bin/phing"
  }
}

Then run composer run build in your console.

Expected behavior I want to get the same result from both commands: composer run build and vendor/bin/phing.

Screenshots / terminal output composer run build:

sshot-13

vendor/bin/phing:

sshot-14

Additional context Phing 3.0.0-rc6 Composer 2.6.5 PHP 8.2.13

dragomano avatar Dec 17 '23 18:12 dragomano

I'm unable to reproduce this (PHP 8.3.1). Phing prompts in both cases.

mrook avatar Feb 11 '24 15:02 mrook

It's not a matter of whether it prompts or not, it's a matter of whether it waits for the user's response (input) in one case, and just automatically selects the default answer and completes the input itself without waiting for the user in the other case.

dragomano avatar Feb 11 '24 15:02 dragomano

That's what I mean, in both cases I get a prompt which waits for input.

mrook avatar Feb 11 '24 15:02 mrook

There must be a problem with something else. For example, in Windows.

dragomano avatar Feb 11 '24 17:02 dragomano

Could be. I don't have access to a Windows machine so I can't confirm that (or write a fix).

mrook avatar Feb 11 '24 19:02 mrook