Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Replace URLS after content import #166

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions features/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function ( &$app = null, $features, $domain ) use ( $defaults ) {
$features = array_merge( $defaults, $features );
if ( $features['content'] ) {
debug( '%s: Adding pre-generated content', $domain );
add_content();
add_content( $domain, $features );
}
},
1,
Expand All @@ -43,11 +43,17 @@ function ( $features, $json_params ) {

/**
* Command to add content.
*
* @param string $domain The domain name of the new site.
* @param array $features Array of features for the new site.
*/
function add_content() {
function add_content( $domain, $features ) {
$schema = ( isset( $features['ssl'] ) && $features['ssl'] ) ? 'https://' : 'http://';
$url = $schema . $domain;
$cmd = 'wget https://github.com/manovotny/wptest/archive/master.zip'
. ' && unzip master.zip'
. ' && echo "$(pwd) y $(pwd)/wptest-master/wptest.xml" | wptest-master/wptest-cli-install.sh';
. ' && echo "$(pwd) y $(pwd)/wptest-master/wptest.xml" | wptest-master/wptest-cli-install.sh'
. " && wp search-replace http://wpthemetestdata.wordpress.com $url";
add_filter(
'jurassic_ninja_feature_command',
function ( $s ) use ( $cmd ) {
Expand Down
2 changes: 1 addition & 1 deletion lib/stuff.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ function ( $s ) use ( $cmd ) {
function require_feature_files() {
$available_features = array(
'/features/logged-in-user-email-address.php',
'/features/content.php',
'/features/multisite.php',
'/features/ssl.php',
'/features/content.php',
'/features/plugins.php',
'/features/jetpack-licensing.php',
'/features/jetpack-beta.php',
Expand Down