Skip to content

Commit 2945a79

Browse files
fix(update-checker): check that command files are executable by default (#100)
Co-authored-by: Stanislav Zhuk <stasadev@gmail.com>
1 parent b4ec056 commit 2945a79

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/scripts/update-checker.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# - Docker Compose files for offline usage support
1212
# - File formatting (trailing newlines, whitespace)
1313
# - Proper shebangs in command files
14+
# - Command files are executable
1415
#
1516
# Usage (run from the add-on root directory):
1617
# curl -fsSL https://ddev.com/s/addon-update-checker.sh | bash
@@ -197,6 +198,16 @@ check_shebang() {
197198
done < <(find commands -type f -print0 2>/dev/null || true)
198199
}
199200

201+
# Check that certain commands/**/* files are executable
202+
check_command_executability() {
203+
local file
204+
while IFS= read -r -d '' file; do
205+
if [[ ! -x "$file" ]]; then
206+
actions+=("$file should be executable, run 'chmod +x \"$file\"'")
207+
fi
208+
done < <(find commands -type f -print0 2>/dev/null || true)
209+
}
210+
200211
# Check .github/workflows/tests.yml for required conditions
201212
check_tests_workflow() {
202213
local tests_yml=".github/workflows/tests.yml"
@@ -278,7 +289,7 @@ check_addon_template_mentions() {
278289
# Check LICENSE file for Apache License
279290
check_license() {
280291
local license_file="LICENSE"
281-
292+
282293
if [[ -f "$license_file" ]]; then
283294
if ! grep -q "Apache License" "$license_file"; then
284295
actions+=("LICENSE should contain 'Apache License', see upstream file $UPSTREAM/$license_file")
@@ -368,6 +379,9 @@ main() {
368379
# Check shebang in commands/**/* files
369380
check_shebang
370381

382+
# Check commands/**/* files are executable
383+
check_command_executability
384+
371385
# Check tests workflow
372386
check_tests_workflow
373387

0 commit comments

Comments
 (0)