Fixes #148. Fix PHP for when filters are not set.

This commit is contained in:
Glavin Wiechert 2014-12-27 19:51:27 -04:00
parent 825b49ad0f
commit 9b38dc3bad
1 changed files with 9 additions and 2 deletions

View File

@ -6,12 +6,19 @@ getCmd = (inputPath, outputPath, options) ->
filters = options.filters
directoryFilters = options.directory_filters # jshint ignore: line
cmd = "--input \"#{inputPath}\" --output \"#{outputPath}\""
if filters
cmd += " --filters \"#{filters}\""
if directoryFilters
cmd += " --directory_filters \"#{directoryFilters}\""
if phpBeautifierPath
# Use absolute path
"php \"#{phpBeautifierPath}\" --input \"#{inputPath}\" --output \"#{outputPath}\" --filters \"#{filters}\" --directory_filters \"#{directoryFilters}\""
"php \"#{phpBeautifierPath}\" #{cmd}"
else
# Use command available in $PATH
"php_beautifier --input \"#{inputPath}\" --output \"#{outputPath}\" --filters \"#{filters}\" --directory_filters \"#{directoryFilters}\""
"php_beautifier #{cmd}"
"use strict"
cliBeautify = require("./cli-beautify")