ircmaxell / php-compiler

A compiler. For PHP
MIT License
794 stars 33 forks source link

Add support for windows run with cygwin #69

Open PurHur opened 5 years ago

PurHur commented 5 years ago

I removed the php command because there is a cygwin support layer in bin/phpunit. Im no windows guy but looks fine for me?

Error:

purhur@purhur-PC MINGW64 ~/php-compiler (master)
$ docker run -v /c/Users/purhur/php-compiler:/compiler ircmaxell/php-compiler:1
6.04-dev php vendor/bin/phpunit

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

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

"${dir}/phpunit" "$@"

With the fix:

purhur@purhur-PC MINGW64 ~/php-compiler (master)
$ docker run -v /c/Users/purhur/php-compiler:/compiler ircmaxell/php-compiler:1
6.04-dev vendor/bin/phpunit
PHPUnit 8.2-g21ee615 by Sebastian Bergmann and contributors.

..........................................................        58 / 58 (100%)

Time: 1.29 minutes, Memory: 6.00 MB

OK (58 tests, 86 assertions)

Without the php it runs fine with Ubutu 16 as host and windows 7 with cygwin docker-for-windows console as host system.

driusan commented 5 years ago

Maybe there should be an Appveyor build to test on Windows too?

PurHur commented 5 years ago

It works very easy under windows, even testing.

Git for Windows Docker for Windows Make Port for Windows copy content to ...\Git\mingw64\

And it runs.