Skip to content

Commit 2514df8

Browse files
committed
🗄 [chore] Shell script should be executable
1 parent 3b429a3 commit 2514df8

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ repos:
22
- repo: local
33
hooks:
44
- id: eslint-json
5-
name: ESLint (JSON)
5+
name: JSON should be formatted and sorted
66
entry: eslint
77
language: node
88
additional_dependencies:
99
- eslint
1010
- "@eslint/json"
1111
files: \.json$
1212
types: [file]
13+
- id: chmod-sh
14+
name: Shell script should be executable
15+
entry: bin/chmod-sh
16+
language: system
17+
files: \.sh$

bin/chmod-sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Pre-commit hook: ensure staged .sh files have the executable bit set in
5+
# both the working tree and the index, so Makefile recipes invoking
6+
# pkg/**/*.sh do not break on a missing exec bit after fresh checkouts.
7+
8+
for f in "$@"; do
9+
chmod +x "$f"
10+
git update-index --chmod=+x -- "$f"
11+
done

lib/brew.sh

100644100755
File mode changed.

pkg/macos-hammerspoon/macos-hammerspoon.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)