Fixes #269. Fix beautifying PHP with CLI path set for Windows
Windows requires `php` command to interpret php-cs-fixer
This commit is contained in:
parent
712cca71f0
commit
6c8cce31c6
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue