Skip to content

Commit b53fa84

Browse files
committed
Add poser command which is really a compound command
1 parent efb3bc6 commit b53fa84

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Commands
1010
============
1111
This project provides the following DDEV container commands.
1212

13-
- [ddev expand-composer-json](https://github.com/weitzman/ddev-drupal-contrib/blob/main/commands/web/expand-composer-json). This edits composer.json so that `drupal/core-recommended` becomes a dev dependency. After this runs you may want to run `ddev composer install`
14-
- [ddev symlink-project](https://github.com/weitzman/ddev-drupal-contrib/blob/main/commands/web/symlink-project). This symlinks the top level files of your project into web/moduels/custom so that Drupal finds your module. This command runs automatically on every `ddev start`. See image below.
13+
- [ddev poser](https://github.com/weitzman/ddev-drupal-contrib/blob/main/commands/web/poser). This edits composer.json so that `drupal/core-recommended` becomes a dev dependency. then, it runs `composer install`. It is perfectly acceptable to skip this command and edit the require-dev of composer.json by hand.
14+
- [ddev symlink-project](https://github.com/weitzman/ddev-drupal-contrib/blob/main/commands/web/symlink-project). This symlinks the top level files of your project into web/modules/custom so that Drupal finds your module. This command runs automatically on every `ddev start`. See codebase image below.
1515
- `ddev phpunit`. Run phpunit tests on the web/modules/custom directory.
1616
- `ddev nightwatch`. Run nightwatch tests on the web/modules/custom directory.
1717
- `ddev phpcs`. Run phpcs on the web/modules/custom directory.

commands/web/poser

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
#ddev-generated
4+
## Command provided by https://github.com/weitzman/ddev-drupal-contrib
5+
## Description: Expand composer.json and run composer install.
6+
## Usage: poser [flags] [args]
7+
## Example: "ddev poser"
8+
## ProjectTypes: drupal8,drupal9,drupal10
9+
## ExecRaw: true
10+
11+
export COMPOSER=composer.contrib.json
12+
.ddev/commands/web/expand-composer-json $DDEV_PROJECT_NAME
13+
composer install
14+
rm composer.contrib.json composer.contrib.lock

config.contrib.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
## Command provided by https://github.com/weitzman/ddev-drupal-contrib
33
hooks:
44
post-start:
5-
- exec-host: "[[ -f vendor/autoload.php ]] && ddev symlink-project"
6-
# pre-composer:
7-
# - exec-host: "[[ -f composer.contrib.json ]] && exit 'composer.contrib.json file not found. please run 'ddev expand-composer-json' and then rerun 'ddev composer'"
5+
- exec-host: "[[ -f vendor/autoload.php ]] && ddev symlink-project"

0 commit comments

Comments
 (0)