Created
April 20, 2014 23:26
-
-
Save tuksik/11127903 to your computer and use it in GitHub Desktop.
Add ORGANIZATION in librarian-puppet-modules
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 | |
$file = file('librarian-puppet-modules.txt'); | |
$new_modules = array(); | |
foreach($file as $key=>$row){ | |
$pattern = '%puphpet/.*-%i'; | |
preg_match($pattern, $row, $matches); | |
$word = str_ireplace('puphpet/','',$matches[0]); | |
$word = str_ireplace('-','',$word); | |
$new_row = str_ireplace("mod '","mod '$word/",$row); | |
$new_modules[] =$new_row; | |
} | |
file_put_contents('new_modules.txt',$new_modules); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment