Last active
October 11, 2015 03:37
-
-
Save there4/3796563 to your computer and use it in GitHub Desktop.
Pake Readme build
This file contains hidden or 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
pake_desc('Update the README with the latest command output'); | |
pake_task('readme'); | |
function run_readme() | |
{ | |
pake_echo_comment('Updating README documentation'); | |
$startPoint = '## Help'; | |
$endPoint = '## Examples'; | |
$readme = file_get_contents('README.md'); | |
$help = shell_exec('php ./md2resume_dev.php list --no-interaction'); | |
$output = preg_replace( | |
'/('.preg_quote($startPoint).')(.*)('.preg_quote($endPoint).')/si', | |
"$1\n```\n" . $help . "\n```\n$3", | |
$readme | |
); | |
file_put_contents('README.md', $output); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment