Skip to content

Commit

Permalink
get_files_from_argument() applies path to strings/arrays too. closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
indeyets committed Jul 17, 2012
1 parent 6aba14d commit d600cb1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/pake/pakeFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,19 @@ public static function get_files_from_argument($arg, $target_dir = '', $relative
$files = array();

if (is_array($arg)) {
$files = $arg;
if (strlen($target_dir) > 0) {
foreach ($arg as $path) {
$files[] = $target_dir.'/'.$path;
}
} else {
$files = $arg;
}
} elseif (is_string($arg)) {
$files[] = $arg;
if (strlen($target_dir) > 0) {
$files[] = $target_dir.'/'.$arg;
} else {
$files[] = $arg;
}
} elseif ($arg instanceof pakeFinder) {
/** @var $arg pakeFinder */
$files = $arg->in($target_dir);
Expand Down

0 comments on commit d600cb1

Please sign in to comment.