From 4e8030be8eeceef5a14e4bd12e157ceccbbd706c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Sat, 12 Aug 2017 23:07:06 -0300 Subject: [PATCH] drop expand_tilde() tilde expansion is a shell-feature rather not expected to complexify end application. People willing to use ~ inside pathnames may activate the preference in their favourite terminal configuration. while other may prefer to use $HOME and or expect distinct behavior according to their use of sudo... Don't introduce platform/OS complexity inside the wp-cli command. --- advanced-custom-fields-wpcli.php | 1 - lib/acfwpcli/cli.php | 4 +--- lib/acfwpcli/cli_utils.php | 14 -------------- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 lib/acfwpcli/cli_utils.php diff --git a/advanced-custom-fields-wpcli.php b/advanced-custom-fields-wpcli.php index 608ca19..55f71a1 100644 --- a/advanced-custom-fields-wpcli.php +++ b/advanced-custom-fields-wpcli.php @@ -16,7 +16,6 @@ if ( defined( 'WP_CLI' ) && WP_CLI ) { require 'lib/acfwpcli/cli.php'; - require 'lib/acfwpcli/cli_utils.php'; } $acfwpcli = new ACFWPCLI; diff --git a/lib/acfwpcli/cli.php b/lib/acfwpcli/cli.php index e7e449d..4cf78b0 100644 --- a/lib/acfwpcli/cli.php +++ b/lib/acfwpcli/cli.php @@ -80,8 +80,6 @@ function export( $args, $assoc_args ) { $export_path = $this->menu_choice_export_path(); } - $export_path = \ACFWPCLI\CLIUtils::expand_tilde( $export_path ); - if ( ! is_dir( $export_path ) && ! mkdir( $export_path, 0755, false ) ) { WP_CLI::error( 'fieldgroup directory exists or cant be created!' ); } @@ -138,7 +136,7 @@ function import( $args, $assoc_args ) { extract( $assoc_args ); if ( isset( $json_file ) ) { - $choice = \ACFWPCLI\CLIUtils::expand_tilde( $json_file ); + $choice = $json_file; } else if (isset($all) && $all) { $choice = 'all'; } else { diff --git a/lib/acfwpcli/cli_utils.php b/lib/acfwpcli/cli_utils.php deleted file mode 100644 index b25427c..0000000 --- a/lib/acfwpcli/cli_utils.php +++ /dev/null @@ -1,14 +0,0 @@ -