Skip to content

Commit 3a83366

Browse files
committed
修改添加.php_cs的位置
1 parent 4305d69 commit 3a83366

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Plugin/Plugin.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)