|
11 | 11 | # - Docker Compose files for offline usage support |
12 | 12 | # - File formatting (trailing newlines, whitespace) |
13 | 13 | # - Proper shebangs in command files |
| 14 | +# - Command files are executable |
14 | 15 | # |
15 | 16 | # Usage (run from the add-on root directory): |
16 | 17 | # curl -fsSL https://ddev.com/s/addon-update-checker.sh | bash |
@@ -197,6 +198,16 @@ check_shebang() { |
197 | 198 | done < <(find commands -type f -print0 2>/dev/null || true) |
198 | 199 | } |
199 | 200 |
|
| 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 | + |
200 | 211 | # Check .github/workflows/tests.yml for required conditions |
201 | 212 | check_tests_workflow() { |
202 | 213 | local tests_yml=".github/workflows/tests.yml" |
@@ -278,7 +289,7 @@ check_addon_template_mentions() { |
278 | 289 | # Check LICENSE file for Apache License |
279 | 290 | check_license() { |
280 | 291 | local license_file="LICENSE" |
281 | | - |
| 292 | + |
282 | 293 | if [[ -f "$license_file" ]]; then |
283 | 294 | if ! grep -q "Apache License" "$license_file"; then |
284 | 295 | actions+=("LICENSE should contain 'Apache License', see upstream file $UPSTREAM/$license_file") |
@@ -368,6 +379,9 @@ main() { |
368 | 379 | # Check shebang in commands/**/* files |
369 | 380 | check_shebang |
370 | 381 |
|
| 382 | + # Check commands/**/* files are executable |
| 383 | + check_command_executability |
| 384 | + |
371 | 385 | # Check tests workflow |
372 | 386 | check_tests_workflow |
373 | 387 |
|
|
0 commit comments