Skip to content

Instantly share code, notes, and snippets.

@there4
Last active October 11, 2015 03:37
Show Gist options
  • Save there4/3796563 to your computer and use it in GitHub Desktop.
Save there4/3796563 to your computer and use it in GitHub Desktop.
Pake Readme build
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