Skip to content

Commit

Permalink
Fixes #148. Fix PHP for when filters are not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Dec 27, 2014
1 parent 825b49a commit 9b38dc3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/langs/php-beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9b38dc3

Please sign in to comment.