dev/endpoints/get-fields.sh

26 lines
451 B
Bash
Executable File

#!/bin/bash
#
# example:
#
# ./get-fields.sh klimatologia4 node edition
#
# body text_with_summary
# field_author string
# field_file file
#
IFS=$'\n'
SITE_DIR=$1
TYPE=$2
NAME=$3
cd /var/www/sites/$SITE_DIR
for FIELD in $(vendor/drush/drush/drush --fields="Field name","Field type" fi ${TYPE} ${NAME} | tail -n +3 | grep -v '\-\-\-'); do
NAME=$(echo $FIELD | awk '{print $1}')
TYPE=$(echo $FIELD | awk '{print $2}')
echo "$NAME $TYPE"
done