launch-drupal-cms.sh incorrect syntax for bash comparison

Created on 24 March 2025, 9 days ago

Problem/Motivation

There's a bug in the bash launcher script:

https://git.drupalcode.org/project/cms/-/blob/1.0.4/launch-drupal-cms.sh...

shellcheck confirms:

In launch-drupal-cms.sh line 23:
if [ $n > 0 ]; then
        ^-- SC2071 (error): > is for string comparisons. Use -gt instead.

Steps to reproduce

After running the current launcher script, there an empty file named 0 in the current directory; this has been created by the bug as an empty string is redirected to that filename.

Proposed resolution

Per the shellcheck recommendation, use -gt instead for the bash comparison.

User interface changes

Not sure if this is strictly UI, but the behaviour of the script will likely change slightly; I think it'll stop suffixing the first ddev project.

This could cause users some confusion if they re-run the script and ddev uses a different project name? Not really tested that to confirm.

Data model changes

n/a

πŸ› Bug report
Status

Active

Component

General

Created by

πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024