feat: add new-drupal-module
Create a new Drupal module based on my Drupal Module template - https://github.com/opdavies/drupal-module-template
This commit is contained in:
parent
b9077d3399
commit
93e04a554b
20
bin/new-drupal-module
Executable file
20
bin/new-drupal-module
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [[ "$1" == "" || "$2" == "" ]]; then
|
||||||
|
echo "Usage: ${0##*/} <machine-name> <module-name>"; exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
machine_name=$1
|
||||||
|
module_name=$2
|
||||||
|
|
||||||
|
wget --quiet https://github.com/opdavies/drupal-module-template/archive/refs/heads/main.zip
|
||||||
|
unzip main.zip
|
||||||
|
mv drupal-module-template-main "${machine_name}"
|
||||||
|
rm main.zip
|
||||||
|
|
||||||
|
pushd "${machine_name}"
|
||||||
|
just rename "${module_name}"
|
||||||
|
rm -fr .github justfile phpcs.xml.dist
|
||||||
|
popd
|
Loading…
Reference in a new issue