Skip to content

Commit 55fae1d

Browse files
Fixes #21: Add xb-core-set-version command (#20)
Co-authored-by: Travis Carden <travis.carden@gmail.com>
1 parent 12cc3b1 commit 55fae1d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

commands/web/xb-core-set-version

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
## #ddev-generated
4+
## Description: Change the version of Drupal core.
5+
## Usage: xb-core-set-version <core-version>
6+
## Example: ddev core ^11 # Use the latest 11.x.\nddev core 11.0.7 # Use a specific version.\nddev core "^10 || ^11" # Use the latest 10.x or 11.x.
7+
## Aliases: core
8+
## Flags: []
9+
## ExecRaw: true
10+
11+
cd "$DDEV_COMPOSER_ROOT" || exit 1
12+
13+
if [ "$#" -ne 1 ]; then
14+
echo "Error: provide exactly one argument"
15+
echo "Usage: core <core-version>"
16+
exit 1
17+
fi
18+
19+
CORE_VERSION=$1
20+
21+
composer require \
22+
--dev \
23+
--no-update \
24+
"drupal/core-dev:$CORE_VERSION"
25+
composer require \
26+
--no-update \
27+
"drupal/core-recommended:$CORE_VERSION" \
28+
"drupal/core-composer-scaffold:$CORE_VERSION" \
29+
"drupal/core-project-message:$CORE_VERSION"
30+
composer update --with-all-dependencies

install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project_files:
1010
- commands/host/xb-setup
1111
- commands/host/xb-static
1212
- commands/web/xb-autosave
13+
- commands/web/xb-core-set-version
1314
- commands/web/xb-eslint
1415
- commands/web/xb-phpcs
1516
- commands/web/xb-phpstan

0 commit comments

Comments
 (0)