Example #1
0
File: Hooks.php Project: lin3s/cs
 /**
  * Static method that allows to create a .editorconfig symlink,
  * .scss_lint.yml and .eslint.yml files when Composer throws the
  * install or update commands.
  */
 public static function addFiles()
 {
     $app = new Application();
     ScssLint::scssLintFile($app->parameters());
     EsLint::esLintFile($app->parameters());
     $editorConfig = __DIR__ . '/../../../../../.editorconfig';
     $fileSystem = new Filesystem();
     try {
         $fileSystem->remove($editorConfig);
         $fileSystem->symlink(__DIR__ . '/../../.editorconfig', $editorConfig, true);
     } catch (\Exception $exception) {
         echo sprintf("Something wrong happens during the symlink process: \n%s\n", $exception->getMessage());
     }
 }