Composer installs two packages, executes one of the scripts from the command line, and reports an error: the function is defined repeatedly

case : Composer installs two packages, executes the script with vendor/bin/phinx.bat in the way of cli, and returns an error: the function is defined repeatedly.
question : there are indeed env () functions inside both packages. But I"m executing a script for the phinx package, so why does another package load automatically?

and report errors twice.

specific description :

package:

-sharp!/usr/bin/env sh

dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../robmorgan/phinx/bin" && pwd)

if [ -d /proc/cygdrive ] && [[ $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
   -sharp We are in Cgywin using Windows php, so the path must be translated
   dir=$(cygpath -m "$dir");
fi

"${dir}/phinx" "$@"
< hr >
May.27,2021

found the answer through Git Issue, and one of the package developers added judgment code to their env for this question.

Menu