2014-08-10 15:51:44 -06:00
|
|
|
###
|
|
|
|
Requires http://pear.php.net/package/PHP_Beautifier
|
|
|
|
###
|
|
|
|
getCmd = (inputPath, outputPath, options) ->
|
|
|
|
phpBeautifierPath = options.beautifier_path # jshint ignore: line
|
2014-11-19 17:41:26 -07:00
|
|
|
filters = options.filters
|
|
|
|
directoryFilters = options.directory_filters # jshint ignore: line
|
2014-08-10 15:51:44 -06:00
|
|
|
|
2014-12-27 16:51:27 -07:00
|
|
|
cmd = "--input \"#{inputPath}\" --output \"#{outputPath}\""
|
|
|
|
|
|
|
|
if filters
|
|
|
|
cmd += " --filters \"#{filters}\""
|
|
|
|
if directoryFilters
|
|
|
|
cmd += " --directory_filters \"#{directoryFilters}\""
|
|
|
|
|
2014-11-19 17:41:26 -07:00
|
|
|
if phpBeautifierPath
|
2014-08-10 15:51:44 -06:00
|
|
|
# Use absolute path
|
2014-12-27 16:51:27 -07:00
|
|
|
"php \"#{phpBeautifierPath}\" #{cmd}"
|
2014-08-10 15:51:44 -06:00
|
|
|
else
|
|
|
|
# Use command available in $PATH
|
2014-12-27 16:51:27 -07:00
|
|
|
"php_beautifier #{cmd}"
|
2014-11-19 17:41:26 -07:00
|
|
|
|
2014-08-10 15:51:44 -06:00
|
|
|
"use strict"
|
|
|
|
cliBeautify = require("./cli-beautify")
|
|
|
|
module.exports = cliBeautify(getCmd)
|