Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miya0001 committed Nov 22, 2017
1 parent e22a3a1 commit 85f34a5
Show file tree
Hide file tree
Showing 2 changed files with 11 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

0 comments on commit 85f34a5

Please sign in to comment.