We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05af0d7 commit 98fe07aCopy full SHA for 98fe07a
app/Commands/Update.php
@@ -35,6 +35,7 @@ public function handle(): int
35
}
36
37
$hook->install();
38
+ $hook->ensureExecutable();
39
40
if ($this->option('verbose')) {
41
$this->info("{$hook->name} git hook installed successfully.");
app/Hook.php
@@ -85,6 +85,16 @@ public function enable(): void
85
File::put(Platform::cwd(".git/hooks/{$this->hook}"), '#!/bin/sh'.PHP_EOL);
86
87
88
+ /**
89
+ * Ensure the hook is executable.
90
+ */
91
+ public function ensureExecutable(): void
92
+ {
93
+ if ((new Platform)->isNotWindows()) {
94
+ exec('chmod +x '.Platform::cwd(".git/hooks/{$this->hook}"));
95
+ }
96
97
+
98
/**
99
* Checks if the hook uses Whisky.
100
*/
0 commit comments