voceconnect / grunt-composer

A grunt wrapper for composer
17 stars 5 forks source link

Incorrectly returning "Done, no errors" when 'composer install' fails... #23

Closed seanosh closed 9 years ago

seanosh commented 9 years ago

Not sure if this belongs here, but had a project with an errantly committed bin/ folder containing things that would be installed via Composer.

As a result, when attempting to run a grunt build, the composer:install task would fail, but grunt would continue on. The deployment process checks that any command executed returns exit code 0, otherwise the deployment is halted and marked as failed. Since this isn't correctly interpreting the error as an error, the deployment continued on and essential composer mangaged dependencies were missed.

$ grunt build:staging
Running "build:staging" (build) task

Running "composer:install" (composer) task
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing composer/installers (v1.0.18)
    Downloading: 100%

  - Installing squizlabs/php_codesniffer (1.5.5)
    Downloading: 100%

  [ErrorException]
  file_put_contents([redacted, current working directory]/bin/phpcs): failed to open stream: No such file or directory

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]

Done, without errors.

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing squizlabs/php_codesniffer (1.5.5)
    Downloading: 100%

  [ErrorException]
  file_put_contents([redacted, current working directory]/bin/phpcs): failed to open stream: No such file or directory

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]

$ echo $?
1

Sure the composer managed dependencies shouldn't have been committed (and removing them "fixes" things), but the failed composer install shouldn't have a grunt build returning "Done, without errors."

cc: @kevinlangleyjr

seanosh commented 9 years ago

Oh, just saw PR https://github.com/voceconnect/grunt-composer/pull/22 - looks like it's related to this.

lxlang commented 9 years ago

Thanks! I think this Issue is Solved in Version 0.4.4