diff --git a/lib/langs/php-beautify.coffee b/lib/langs/php-beautify.coffee index 7af3f9e5d..bf1b04309 100644 --- a/lib/langs/php-beautify.coffee +++ b/lib/langs/php-beautify.coffee @@ -20,8 +20,17 @@ getCmd = (inputPath, outputPath, options) -> cmd = "#{levelOption} #{fixerOption} \"#{inputPath}\") || (mv \"#{inputPath}\" \"#{outputPath}\")" if phpCsFixerPath + isWin = /^win/.test(process.platform) # Use absolute path - "(\"#{phpCsFixerPath}\" fix #{cmd}" + if isWin + # Windows does require `php` prefix + # See https://github.com/Glavin001/atom-beautify/issues/269 + "php (\"#{phpCsFixerPath}\" fix #{cmd}" + else + # Mac & Linux do not require `php` prefix + # See https://github.com/Glavin001/atom-beautify/pull/263 + "(\"#{phpCsFixerPath}\" fix #{cmd}" + else # Use command available in $PATH "(php-cs-fixer fix #{cmd}"