Skip to content

fix: show curl errors when downloading gitlab_templates files - #186

Merged
weitzman merged 1 commit into
mainfrom
20261016_stasadev_curl_fail
Oct 16, 2026
Merged

weitzman merged 1 commit into
mainfrom
20261016_stasadev_curl_fail

Conversation

@stasadev

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Make symlink-project, expand-composer-json, phpcs, phpcbf and phpstan fail with the HTTP error instead of saving an error page as the downloaded file.

The Issue

curl -OL without --fail saves a 4xx/5xx response from git.drupalcode.org as symlink_project.php, phpcs.xml.dist, etc. For phpcs, phpcbf and phpstan the broken file stays in the project, because the test -e check skips the download next time.

How This PR Solves The Issue

Use curl -fsSL -O. On an HTTP error curl prints the status, writes no file, and the command stops because of set -e.

Manual Testing Instructions

ddev add-on get ddev/ddev-drupal-contrib --pr 186
ddev restart
ddev symlink-project
ddev phpcs --version

Automated Testing Overview

No new tests, the existing tests run these commands.

Release/Deployment Notes

None.

## Short Summary (TL;DR)

Make `symlink-project`, `expand-composer-json`, `phpcs`, `phpcbf` and `phpstan` fail with the HTTP error instead of saving an error page as the downloaded file.

## The Issue

- Related to ddev/ddev-nvm#6

`curl -OL` without `--fail` saves a 4xx/5xx response from git.drupalcode.org as `symlink_project.php`, `phpcs.xml.dist`, etc. For `phpcs`, `phpcbf` and `phpstan` the broken file stays in the project, because the `test -e` check skips the download next time.

## How This PR Solves The Issue

Use `curl -fsSL -O`. On an HTTP error curl prints the status, writes no file, and the command stops because of `set -e`.

## Manual Testing Instructions

```bash
ddev add-on get ddev/ddev-drupal-contrib --pr 186
ddev restart
ddev symlink-project
ddev phpcs --version
```

## Automated Testing Overview

No new tests, the existing tests run these commands.

## Release/Deployment Notes

None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stasadev stasadev changed the title fix: show curl errors when downloading gitlab_templates files (#186) fix: show curl errors when downloading gitlab_templates files Oct 16, 2026
@weitzman
weitzman merged commit c7b034b into main Oct 16, 2026
12 checks passed
@weitzman
weitzman deleted the 20261016_stasadev_curl_fail branch October 16, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants