From 93e04a554b9b72599ad1e0af9aced1a365d8b051 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 9 Jul 2023 12:25:55 +0100 Subject: [PATCH] feat: add new-drupal-module Create a new Drupal module based on my Drupal Module template - https://github.com/opdavies/drupal-module-template --- bin/new-drupal-module | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/new-drupal-module diff --git a/bin/new-drupal-module b/bin/new-drupal-module new file mode 100755 index 0000000..33254cd --- /dev/null +++ b/bin/new-drupal-module @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +if [[ "$1" == "" || "$2" == "" ]]; then + echo "Usage: ${0##*/} "; 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