Created
September 29, 2013 15:27
-
-
Save joshribakoff/6753429 to your computer and use it in GitHub Desktop.
Moving test files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function main($dir) | |
{ | |
foreach(glob($dir.'/*') as $dir) { | |
// if this is a test file / folder | |
if(preg_match('/Test(.php)?/', $dir)) { | |
$newFile = "tests/VF" . str_replace('library/VF', '', $dir); | |
$newPath = dirname($newFile); | |
`mkdir -p $newPath`; | |
`mv $dir $newFile`; | |
continue; | |
} | |
if(is_dir($dir)) { | |
main($dir); | |
} | |
} | |
} | |
main('library/VF'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment