Skip to content

Commit c99febe

Browse files
authored
Add 'xb-workspaces-dev' command. (#28)
1 parent 5b1f65d commit c99febe

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

commands/web/xb-workspaces-dev

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
## #ddev-generated
4+
## Description: Configure the environment for Workspaces development.
5+
## Usage: xb-workspaces-dev
6+
## Example: ddev xb-workspaces-dev\nddev xb-workspaces-dev --dry-run
7+
## Aliases: workspaces,wse
8+
## Flags: [{"Name":"dry-run","Usage":"Show what the command will do if run"}]
9+
10+
# If the '--dry-run' flag is passed, show what the command would do and then exit.
11+
if [[ "$1" == "--dry-run" ]]; then
12+
echo "This command will...
13+
1. Install the following modules:
14+
- Workspaces (workspaces)
15+
- Workspaces UI (workspaces_ui)
16+
- Workspaces Extras (wse)
17+
- Workspaces Config (wse_config)
18+
2. Perform the following configuration:
19+
- Use the simplified workspace switcher in the toolbar
20+
- Disable sub workspaces"
21+
exit 0
22+
fi
23+
24+
# Add the modules to the codebase. Use dev branches to always get
25+
# the latest commits and to facilitate upstream contribution.
26+
composer require \
27+
--prefer-source \
28+
--no-interaction \
29+
drupal/wse:dev-2.0.x \
30+
drupal/wse_config:dev-2.0.x
31+
32+
# Install the modules in Drupal.
33+
drush en -y \
34+
workspaces \
35+
workspaces_ui \
36+
wse \
37+
wse_config
38+
39+
# Use the simplified workspace switcher in the toolbar.
40+
drush config:set -y \
41+
wse.settings \
42+
simplified_toolbar_switcher \
43+
true
44+
45+
# Disable sub workspaces.
46+
drush config:set -y \
47+
wse.settings \
48+
disable_sub_workspaces \
49+
true

install.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ project_files:
2020
- commands/web/xb-stylelint
2121
- commands/web/xb-ui-build
2222
- commands/web/xb-ui-dev
23+
- commands/web/xb-workspaces-dev
2324
- config.drupal-xb-dev.yaml
2425

2526
post_install_actions:

0 commit comments

Comments
 (0)