Skip to content

Instantly share code, notes, and snippets.

@raidenz
Last active January 22, 2016 04:00
Show Gist options
  • Save raidenz/da9832e2fd80d1477caa to your computer and use it in GitHub Desktop.
Save raidenz/da9832e2fd80d1477caa to your computer and use it in GitHub Desktop.
cygwin fix php
#!/bin/bash
# fix wp-cli di cygwin
# save as php
# jika muncul error '\r' gunakan dos2unix php
# masukkan wp dan php ke /usr/local/bin
# chmod +x php
# chmod +x wp
# e.g. php="/cygdrive/c/Program Files (x86)/php/php.exe"
php="/cygdrive/c/xampp/php/php.exe"
for ((n=1; n <= $#; n++)); do
if [ -e "${!n}" ]; then
# Converts Unix style paths to Windows equivalents
path="$(cygpath --mixed ${!n} | xargs)"
case 1 in
$(( n == 1 )) )
set -- "$path" "${@:$(($n+1))}";;
$(( n < $# )) )
set -- "${@:1:$((n-1))}" "$path" ${@:$((n+1)):$#};;
*)
set -- "${@:1:$(($#-1))}" "$path";;
esac
fi
done
"$php" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment