Skip to content

Commit

Permalink
Fix bug scaffold-tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
inc2734 committed Oct 28, 2016
1 parent 60926eb commit bafe543
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/bin/scaffold-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

set -e;

themedir=$(wp theme path $(wp theme list --field=name --status=active) --dir)
theme=$(wp theme list --field=name --status=active)
themedir=$(wp theme path $theme --dir)

phar extract -f $(which wp) "$themedir/app/bin/wp.phar">/dev/null 2>&1
wpclidir="$themedir/app/bin/wp.phar$(which wp)"

Expand All @@ -19,7 +21,7 @@ if [ ! -e "$themedir/tests" ]; then
fi

cp -f "$wpclidir/templates/bootstrap.mustache" "$themedir/tests/bootstrap.mustache"
sed -e "s/require dirname( dirname( __FILE__ ) ) \. '\/{{plugin_slug}}\.php';/register_theme_directory( dirname( __FILE__ ) . '\/\.\.\/\.\.\/' ); switch_theme('mimizuku');/g" "$themedir/tests/bootstrap.mustache">"$themedir/tests/bootstrap.php"
sed -e "s/require dirname( dirname( __FILE__ ) ) \. '\/{{plugin_slug}}\.php';/register_theme_directory( dirname( __FILE__ ) . '\/\.\.\/\.\.\/' ); switch_theme('$theme');/g" "$themedir/tests/bootstrap.mustache">"$themedir/tests/bootstrap.php"
rm -f "$themedir/tests/bootstrap.mustache"

cp -f "$wpclidir/templates/test-sample.mustache" "$themedir/tests/test-sample.php"
Expand Down

0 comments on commit bafe543

Please sign in to comment.