Whether a hook body is just a shebang / blank lines (i.e. only ever ours).
(content: string)
| 103 | |
| 104 | /** Whether a hook body is just a shebang / blank lines (i.e. only ever ours). */ |
| 105 | function isEffectivelyEmpty(content: string): boolean { |
| 106 | return content |
| 107 | .split('\n') |
| 108 | .map((l) => l.trim()) |
| 109 | .every((l) => l.length === 0 || l.startsWith('#!')); |
| 110 | } |
| 111 | |
| 112 | function chmodExecutable(file: string): void { |
| 113 | try { |