From bbf67b19182e2f866a8cfd8da3e625cc32a7ae4f Mon Sep 17 00:00:00 2001 From: Vincent Massaro Date: Fri, 12 Jan 2024 11:29:13 -0500 Subject: [PATCH] feat: content on install to environments other than dev We need the ability to set the environment dynamically when calling this script, so change to using a variable and fall back to dev if it isn't set. --- scripts/shared/content-import.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/shared/content-import.sh b/scripts/shared/content-import.sh index 7405485e03..68ceb15aee 100755 --- a/scripts/shared/content-import.sh +++ b/scripts/shared/content-import.sh @@ -22,10 +22,11 @@ if [ "$YALESITES_IS_LOCAL" == "1" ]; then homepage_nid=$(lando drush ev "$nid_command") lando drush cset system.site page.front "$homepage_nid" -y else - COMMAND=$(terminus connection:info "$SITE_MACHINE_NAME".dev --field=sftp_command) + [ -z "$env" ] && env="dev" + COMMAND=$(terminus connection:info "$SITE_MACHINE_NAME"."$env" --field=sftp_command) eval "$COMMAND:/files/ <<< 'put $STARTERKIT_FILE'" - terminus drush "$SITE_MACHINE_NAME".dev -- content:import ../../files/"$STARTERKIT_FILE" + terminus drush "$SITE_MACHINE_NAME"."$env" -- content:import ../../files/"$STARTERKIT_FILE" eval "$COMMAND:/files/ <<< 'rm $STARTERKIT_FILE'" - homepage_nid=$(echo "$nid_command" | terminus drush "$SITE_MACHINE_NAME".dev -- php-script - 2>/dev/null) - terminus drush "$SITE_MACHINE_NAME".dev -- cset system.site page.front "$homepage_nid" -y + homepage_nid=$(echo "$nid_command" | terminus drush "$SITE_MACHINE_NAME"."$env" -- php-script - 2>/dev/null) + terminus drush "$SITE_MACHINE_NAME"."$env" -- cset system.site page.front "$homepage_nid" -y fi