Skip to content

Commit

Permalink
Fix #43
Browse files Browse the repository at this point in the history
  • Loading branch information
inc2734 committed Jun 6, 2017
1 parent 0d8975e commit 446e933
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 26 deletions.
36 changes: 23 additions & 13 deletions app/bin/theme-unit-test-ja.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@ datetime=`date +%Y%m%d%H%M%S`
wp db export "$themedir/../../dump-$datetime.sql"

if [ -e "$themedir/../../dump-$datetime.sql" ]; then
wp plugin install --activate wordpress-importer
wp plugin is-installed wordpress-importer

if [ $? -eq 0 ]; then
wp menu delete $(wp menu list --fields=term_id) --quiet
wp post delete $(wp post list --post_type=page,post --posts_per_page=-1 --format=ids) --force --quiet

wget https://raw.githubusercontent.com/jawordpressorg/theme-test-data-ja/master/wordpress-theme-test-date-ja.xml -P $themedir
wp import "$themedir/wordpress-theme-test-date-ja.xml" --authors=create --quiet
wp menu location assign "All Pages" global-nav
wp menu location assign "All Pages" drawer-nav
rm -rf "$themedir/wordpress-theme-test-date-ja.xml"
fi
wp plugin is-installed wordpress-importer

if [ $? -ne 0 ]; then
wp plugin install --activate wordpress-importer
fi

if [ $? -eq 0 ]; then
wp menu list --format=ids
if [ $? -ne 0 ]; then
wp menu delete $?
fi

wp post list --post_type=page,post --posts_per_page=-1 --format=ids
if [ $? -ne 0 ]; then
wp post delete $?
fi

wget https://raw.githubusercontent.com/jawordpressorg/theme-test-data-ja/master/wordpress-theme-test-date-ja.xml -P $themedir
wp import "$themedir/wordpress-theme-test-date-ja.xml" --authors=create --quiet
wp menu location assign "All Pages" global-nav
wp menu location assign "All Pages" drawer-nav
rm -rf "$themedir/wordpress-theme-test-date-ja.xml"
fi
fi
36 changes: 23 additions & 13 deletions app/bin/theme-unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,27 @@ datetime=`date +%Y%m%d%H%M%S`
wp db export "$themedir/../../dump-$datetime.sql"

if [ -e "$themedir/../../dump-$datetime.sql" ]; then
wp plugin install --activate wordpress-importer
wp plugin is-installed wordpress-importer

if [ $? -eq 0 ]; then
wp menu delete $(wp menu list --fields=term_id) --quiet
wp post delete $(wp post list --post_type=page,post --posts_per_page=-1 --format=ids) --force --quiet

wget https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml -P $themedir
wp import "$themedir/theme-unit-test-data.xml" --authors=create --quiet
wp menu location assign "All Pages" global-nav
wp menu location assign "All Pages" drawer-nav
rm -rf "$themedir/theme-unit-test-data.xml"
fi
wp plugin is-installed wordpress-importer

if [ $? -ne 0 ]; then
wp plugin install --activate wordpress-importer
fi

if [ $? -eq 0 ]; then
wp menu list --format=ids
if [ $? -ne 0 ]; then
wp menu delete $?
fi

wp post list --post_type=page,post --posts_per_page=-1 --format=ids
if [ $? -ne 0 ]; then
wp post delete $?
fi

wget https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml -P $themedir
wp import "$themedir/theme-unit-test-data.xml" --authors=create --quiet
wp menu location assign "All Pages" global-nav
wp menu location assign "All Pages" drawer-nav
rm -rf "$themedir/theme-unit-test-data.xml"
fi
fi

0 comments on commit 446e933

Please sign in to comment.