Merge pull request #2134 from szeck87/docker-fix

Fix php-cs-fixer not running from phar files
This commit is contained in:
Steven Zeck 2018-05-15 15:24:07 -05:00 committed by GitHub
commit cfc7b86737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -66,7 +66,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
curl https://nixos.org/nix/install | sh &&
. ~/.nix-profile/etc/profile.d/nix.sh &&
nix-env -i uncrustify R elm-format terraform atom atom-beta opam &&
nix-env -i uncrustify R elm-format terraform atom atom-beta &&
pip install --user -r requirements.txt;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update && brew cask zap oclint && brew bundle &&

View File

@ -1,9 +1,7 @@
tap 'homebrew/php'
tap 'caskroom/versions'
brew 'uncrustify'
brew 'r'
brew 'composer'
brew 'opam'
brew 'crystal-lang'
brew 'terraform'
brew 'elm-format'

View File

@ -389,6 +389,9 @@ class HybridExecutable extends Executable
installedWithDocker: false
init: () ->
super()
.then(() =>
return @
)
.catch((error) =>
return Promise.reject(error) if not @docker?
return @
@ -400,6 +403,13 @@ class HybridExecutable extends Executable
return @initDocker()
return @
)
.catch((error) =>
if not @.required
@verbose("Not required")
@
else
Promise.reject(error)
)
initDocker: () ->
@docker.init()
@ -409,7 +419,7 @@ class HybridExecutable extends Executable
.then(=> @)
.catch((dockerError) =>
@debug(dockerError)
Promise.reject(error)
Promise.reject(dockerError)
)
run: (args, options = {}) ->

View File

@ -67,7 +67,8 @@ module.exports = class PHPCSFixer extends Beautifier
phpCsFixerOptions = [
"fix"
"--rules=#{options.rules}" if options.rules
"--config=#{options.cs_fixer_config_file}" if options.cs_fixer_config_file
"--config" if options.cs_fixer_config_file
"#{options.cs_fixer_config_file}" if options.cs_fixer_config_file
"--allow-risky=#{options.allow_risky}" if options.allow_risky
"--using-cache=no"
]