Skip to content

Commit 0e6fe35

Browse files
authored
Merge pull request #7 from valicm/6-add-validation-for-output-file-that-is-of-md-extension
Validate md extension. Fix broken release link
2 parents 84b3996 + a5c7881 commit 0e6fe35

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,9 @@ jobs:
6969
| Run any update, except for Drupal core | `bash drupal-update.sh -t all -c false` |
7070
| Run minor update, excluding some modules | `bash drupal-update.sh -e pathauto,redirect` |
7171
| Run all updates, saving summary in upgrade.md | `bash drupal-update.sh -t all -o upgrade.md` |
72+
73+
74+
Get all minor updates and output results in summary.md file.
75+
```bash
76+
curl -fsSL https://raw.githubusercontent.com/valicm/drupal-update/main/drupal-update.sh | bash -s -- -o summary.md
77+
```

drupal-update.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ validate_options() {
4747
echo "Error: Core flag must be either true or false. Default if empty is false"
4848
exit_error
4949
fi
50+
51+
if [ -n "$SUMMARY_FILE" ] && [[ "$SUMMARY_FILE" != *.md ]]; then
52+
echo "Error: Summary output file needs to end with .md extension"
53+
exit_error
54+
fi
5055
}
5156

5257
# Validate if all requirements are present.
@@ -156,7 +161,7 @@ UPDATES=$(composer outdated "drupal/*" -f json -D --locked --ignore-platform-req
156161
for UPDATE in $(echo "${UPDATES}" | jq -c '.locked[]'); do
157162
PROJECT_NAME=$(echo "${UPDATE}" | jq '."name"' | sed "s/\"//g")
158163
PROJECT_URL=$(echo "${UPDATE}" | jq '."homepage"' | sed "s/\"//g")
159-
if [ -n "$PROJECT_URL" ]; then
164+
if [ -z "$PROJECT_URL" ] || [ "$PROJECT_URL" == null ]; then
160165
PROJECT_URL="https://www.drupal.org/project/drupal"
161166
fi
162167
CURRENT_VERSION=$(echo "${UPDATE}" | jq '."version"' | sed "s/\"//g")

0 commit comments

Comments
 (0)