I am using composer in part of a project setup workflow. Each part of the setup will log its results and any other relevant info to file. I am having trouble capturing the output of composer install
. When I run composer install
directly from the command line the packages are correctly installed and I see the output in the command window. When I run it from a cmd file the packages are installed but the output is not saved to file, however, other composer commands (-V, help etc.) do have their output saved to file.
I know the help and -V commands do not need to cd
but I left that in the test1 and test2 cmd files to rule out that had anything to do with the issue.
The following are the contents and results of a few .cmd files.
test1.cmd
@ECHO OFF
cd "C:\path\to\project"
composer -V > test1.txt
test1.txt contents
Composer version 1.2.1 2016-09-12 11:27:19
test2.cmd
@ECHO OFF
cd "C:\path\to\project"
composer help > test2.txt
test2.txt contents
Usage:
help [options] [--] [<command_name>]
Arguments:
command The command to execute
command_name The command name [default: "help"]
Options:
--xml To output help as XML
...truncated
test3.cmd
@ECHO OFF
cd "C:\path\to\project"
composer install > test3.txt
test3.txt is created but is an empty 0 kb file.
Why can I capture the output of some composer commands but not the install command? What is different about that particular command?