From 1b9f3c33a12b444e1fd994e8ce8a3ae6fecf24ca Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 13 Feb 2017 00:12:56 -0500 Subject: [PATCH] Add better instructions for --init --- bin/psalm | 13 +++++++++---- examples/psalm.default.xml | 21 --------------------- 2 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 examples/psalm.default.xml diff --git a/bin/psalm b/bin/psalm index 0d99c3644..df8c21272 100755 --- a/bin/psalm +++ b/bin/psalm @@ -121,12 +121,17 @@ if (isset($options['i'])) { $level = (int)$args[1]; } - if (!file_exists($args[0])) { - $bad_dir_path = getcwd() . DIRECTORY_SEPARATOR . $args[0]; - die('The given path ' . $bad_dir_path . ' does not appear to be a directory' . PHP_EOL); + $source_dir = $args[0]; + } + + if (!is_dir($source_dir)) { + $bad_dir_path = getcwd() . DIRECTORY_SEPARATOR . $source_dir; + + if (!isset($args[0])) { + die('Please specify a directory - the default, "src", was not found in this project.' . PHP_EOL); } - $source_dir = $args[0]; + die('The given path "' . $bad_dir_path . '" does not appear to be a directory' . PHP_EOL); } $template_file_name = 'assets/config_levels/' . $level . '.xml'; diff --git a/examples/psalm.default.xml b/examples/psalm.default.xml deleted file mode 100644 index 2f585c723..000000000 --- a/examples/psalm.default.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - -