Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Mar 4, 2018
2 parents a5df705 + 1b24bb3 commit 3f1776c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "http://vccw.cc/"
}
],
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"": "src/"
Expand All @@ -22,6 +23,7 @@
},
"require": {},
"require-dev": {
"behat/behat": "~2.5"
"behat/behat": "~2.5",
"wp-cli/wp-cli": "dev-master"
}
}
15 changes: 8 additions & 7 deletions src/Scaffold_Movefile_Command.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

use WP_CLI\Utils;

/**
* Generate a movefile.yml for Wordmove.
*
Expand Down Expand Up @@ -89,28 +87,31 @@ private function create_file( $filename, $contents, $force )

/**
* Initialize WP Filesystem
*
* @return \WP_Filesystem_Base
*/
private function init_wp_filesystem()
{
global $wp_filesystem;

WP_Filesystem();

return $wp_filesystem;
}

private function prompt_if_files_will_be_overwritten( $filename, $force )
{
$should_write_file = false;
if ( ! file_exists( $filename ) ) {
return true;
}

WP_CLI::warning( 'File already exists.' );

if ( $force ) {
$should_write_file = true;
return true;
} else {
$should_write_file = cli\confirm( 'Do you want to overwrite', false );
return cli\confirm( 'Do you want to overwrite', false );
}

return $should_write_file;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/templates/movefile.mustache
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
global:
sql_adapter: default

local:
vhost: "{{ home_url }}"
wordpress_path: "{{ wordpress_path }}" # use an absolute path here
Expand Down

0 comments on commit 3f1776c

Please sign in to comment.