Skip to content

Instantly share code, notes, and snippets.

@joshribakoff
Created September 29, 2013 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshribakoff/6753429 to your computer and use it in GitHub Desktop.
Save joshribakoff/6753429 to your computer and use it in GitHub Desktop.
Moving test files
<?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