From 5433fa7a687ccb913149cd88a2ba7dda301d5052 Mon Sep 17 00:00:00 2001 From: laurielim Date: Thu, 31 Aug 2023 15:24:26 +0300 Subject: [PATCH 1/3] Add cmd for login w given uid --- make/drupal.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make/drupal.mk b/make/drupal.mk index c79e951..8da0993 100644 --- a/make/drupal.mk +++ b/make/drupal.mk @@ -74,6 +74,12 @@ drush-uli: ## Get login link $(call step,Login to your site with:\n) $(call drush,uli$(if $(DRUPAL_UID), --uid=$(DRUPAL_UID),) $(DRUPAL_DESTINATION)) +PHONY += drush-uli-% +drush-uli-%: DRUPAL_DESTINATION ?= admin/reports/status +drush-uli-%: ## Get login link for provided uid + $(call step,Login to your site as user $* with:\n) + $(call drush,uli --uid=$* $(DRUPAL_DESTINATION)) + PHONY += drush-si ifeq ($(DRUPAL_CONF_EXISTS),yes) drush-si: DRUSH_SI := -y --existing-config From fe2104387d177dff9d9700d25751ba80c8df4fb4 Mon Sep 17 00:00:00 2001 From: laurielim Date: Thu, 31 Aug 2023 15:42:32 +0300 Subject: [PATCH 2/3] Remove DRUPAL_DESTINATION --- make/drupal.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/make/drupal.mk b/make/drupal.mk index 8da0993..5f81548 100644 --- a/make/drupal.mk +++ b/make/drupal.mk @@ -75,10 +75,9 @@ drush-uli: ## Get login link $(call drush,uli$(if $(DRUPAL_UID), --uid=$(DRUPAL_UID),) $(DRUPAL_DESTINATION)) PHONY += drush-uli-% -drush-uli-%: DRUPAL_DESTINATION ?= admin/reports/status drush-uli-%: ## Get login link for provided uid $(call step,Login to your site as user $* with:\n) - $(call drush,uli --uid=$* $(DRUPAL_DESTINATION)) + $(call drush,uli --uid=$*) PHONY += drush-si ifeq ($(DRUPAL_CONF_EXISTS),yes) From f183c68403fed61a83a4afbd7a23367dbf208924 Mon Sep 17 00:00:00 2001 From: laurielim Date: Mon, 27 Nov 2023 12:13:28 +0200 Subject: [PATCH 3/3] Add test --- tests/outputs/drush-uli-%.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/outputs/drush-uli-%.txt diff --git a/tests/outputs/drush-uli-%.txt b/tests/outputs/drush-uli-%.txt new file mode 100644 index 0000000..121656f --- /dev/null +++ b/tests/outputs/drush-uli-%.txt @@ -0,0 +1,4 @@ +drush-uli-123 IS_DRUPAL=yes +--- +printf "\n⭐ \033[0;33mLogin to your site as user 123 with:\n\033[0m\n" +drush uli --uid=123