Skip to content

Commit 367587b

Browse files
committed
use existing method to ensure hooks are executable
1 parent a999009 commit 367587b

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

app/Commands/Install.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,14 @@ public function handle(): int
6565
$hook->install();
6666

6767
if ($this->option('verbose')) {
68-
$this->info("{$hook->name} git hook installed successfully.");
68+
$this->info("Ensuring {$hook->name} hook is executable...");
6969
}
70-
});
70+
$hook->ensureExecutable();
7171

72-
if ($this->platform->isNotWindows()) {
7372
if ($this->option('verbose')) {
74-
$this->info('Verifying hooks are executable...');
73+
$this->info("{$hook->name} git hook installed successfully.");
7574
}
76-
exec('chmod +x '.Platform::cwd('.git/hooks').'/*');
77-
}
75+
});
7876

7977
$this->info('Git hooks installed successfully.');
8078

app/Commands/Update.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,16 @@ public function handle(): int
4242
}
4343

4444
$hook->install();
45-
$hook->ensureExecutable();
4645

4746
if ($this->option('verbose')) {
48-
$this->info("{$hook->name} git hook installed successfully.");
47+
$this->info("Ensuring {$hook->name} hook is executable...");
4948
}
50-
});
49+
$hook->ensureExecutable();
5150

52-
if ($this->platform->isNotWindows()) {
5351
if ($this->option('verbose')) {
54-
$this->info('Verifying hooks are executable...');
52+
$this->info("{$hook->name} git hook installed successfully.");
5553
}
56-
exec('chmod +x '.Platform::cwd('.git/hooks').'/*');
57-
}
54+
});
5855

5956
$this->line('Git hooks updated successfully.');
6057

0 commit comments

Comments
 (0)