File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,16 +57,17 @@ public function installGitPreHook() {
5757 if (!file_exists ($ hookDir )) {
5858 throw new \Exception ('not a git project ' );
5959 }
60+
61+ if (!file_exists ($ projectDir . '/.php_cs ' )) {
62+ $ filesystem ->copy (dirname (__DIR__ ) . '/Helper/.php_cs ' , $ projectDir . '/.php_cs ' );
63+ }
6064 if (file_exists ($ hookDir . 'pre-commit-cs-fix ' )) {
6165 return true ;
6266 }
6367
6468 $ filesystem ->copy (dirname (__DIR__ ) . '/Helper/pre-commit-cs-fix ' , $ hookDir . 'pre-commit-cs-fix ' );
6569 $ list [] = $ hookDir . 'pre-commit-cs-fix ' ;
6670
67- if (!file_exists ($ projectDir . '/.php_cs ' )) {
68- $ filesystem ->copy (dirname (__DIR__ ) . '/Helper/.php_cs ' , $ projectDir . '/.php_cs ' );
69- }
7071 if (file_exists ($ hookDir . 'pre-commit ' )) {
7172 file_put_contents ($ hookDir . 'pre-commit ' , "\n exec " . $ hookDir . 'pre-commit-cs-fix ' , FILE_APPEND );
7273 } else {
You can’t perform that action at this time.
0 commit comments