lib/generators/wcc/templates/contentful_shell_wrapper in wcc-contentful-0.2.1 vs lib/generators/wcc/templates/contentful_shell_wrapper in wcc-contentful-0.2.2
- old
+ new
@@ -174,16 +174,18 @@
[[ -z "$ARG" ]] && ARG="db/migrate"
[[ -d "$ARG" ]] && ARG="batch $ARG"
require_environment
+ [[ ! -z "$CONTENTFUL_ENVIRONMENT" ]] && ENV="--environment-id $CONTENTFUL_ENVIRONMENT"
+
execv node_modules/.bin/ts-node node_modules/.bin/contentful-migration \
- -s $CONTENTFUL_SPACE_ID -a $CONTENTFUL_MANAGEMENT_TOKEN \
+ -s $CONTENTFUL_SPACE_ID $ENV -a $CONTENTFUL_MANAGEMENT_TOKEN \
$YES -p $ARG
mkdir -p db
execv node_modules/.bin/contentful-export --export-dir db --content-file contentful-schema.json \
- --space-id $CONTENTFUL_SPACE_ID --management-token $CONTENTFUL_MANAGEMENT_TOKEN \
+ --space-id $CONTENTFUL_SPACE_ID $ENV --management-token $CONTENTFUL_MANAGEMENT_TOKEN \
--query-entries 'content_type=migrationHistory' \
--query-assets 'sys.id=false'
if [[ $(git diff-index --name-only HEAD | grep 'db/contentful-schema.json') == "" ]]; then
echo -e "${COLOR_LGREEN}✓ Schema in contentful space is equivalent to stored schema${COLOR_NC}"
\ No newline at end of file