Skip to content

Commit

Permalink
Optimize test file names
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Sep 26, 2024
1 parent d097748 commit 62f3c08
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/rename.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

$match = $argv[1];
$files = glob($match);
var_dump($files);

$regx = '/' . str_replace('*', '(.+)', $match) . '/';

$ext = pathinfo($regx, PATHINFO_EXTENSION);

foreach ($files as $file) {
if (is_file($file)) {
preg_match($regx, $file, $matches);
$newName = $matches[1] . '.' . $ext;
`git mv $file $newName`;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 62f3c08

Please sign in to comment.