run "phpcbf.bat" instead of "php phpcbf.bat"

If phpcbfPath is an executable then run it instead of running it as an argument to php
This commit is contained in:
Tony Brix 2016-06-16 20:19:25 -05:00 committed by GitHub
parent c8a654a3ea
commit 1c4d48893f
1 changed files with 7 additions and 2 deletions

View File

@ -37,8 +37,13 @@ module.exports = class PHPCBF extends Beautifier
# Check if phpcbf path was found # Check if phpcbf path was found
if phpcbfPath? if phpcbfPath?
# Found phpcbf path # Found phpcbf path
@run("php", [
phpcbfPath # Check if phpcbf is an executable
isExec = path.extname(phpcbfPath) isnt ''
exec = if isExec then phpcbfPath else "php"
@run(exec, [
phpcbfPath unless isExec
"--no-patch" "--no-patch"
"--standard=#{options.standard}" if options.standard "--standard=#{options.standard}" if options.standard
tempFile = @tempFile("temp", text) tempFile = @tempFile("temp", text)