version . "\n"; echo str_repeat("=", 80) . "\n"; } function run_version_file() { $version = trim(shell_exec('git describe --abbrev=0 --tags')); file_put_contents('./version', $version); } function run_lint() { echo "\n * Linting files\n"; passthru("./build/lint -R ./src"); } function run_phar() { echo " * Construction phar and moving to ./bin/md2resume\n"; $command = 'rm -f ./bin/md2resume && rm -f ./bin/md2resume.phar &&' . 'php -dphar.readonly=0 build/empir make ./bin/md2resume.phar working.php . --exclude="' . '*.git/*|*.gitignore|*test*|*Tests*|*.md|*/doc/*|*.lock|*token.txt|pakefile' . '|.*|build/*|*.markdown|*.phar|*LICENSE|*AUTHORS|*CHANGELOG|*.dist|*.tpl' . '" && chmod a+x ./bin/md2resume.phar' . ' && mv ./bin/md2resume.phar ./bin/md2resume'; passthru($command); } function run_sniff() { echo " * Checking files for PSR2\n"; passthru("phpcs -p --standard=PSR2 ./src/ ./resume.php"); } function run_fixer() { echo "\n * Running php-cs-fixer\n"; passthru( "php-cs-fixer fix ./bin/resume2.php" . " && php-cs-fixer fix ./src/Resume/Cli/" . " && php-cs-fixer fix ./src/Resume/Command/" ); } function run_readme() { echo " * Updating README documentation\n"; $readme = file("README.md"); $help = explode("\n", shell_exec("php ./resume2.php list --no-interaction")); $helpStart = $helpEnd = 0; foreach ($readme as $lineNumber => $line) { if (trim($line) == "## Help") { $helpStart = $lineNumber; continue; } if ($helpStart && (substr(trim($line), 0, 2) == "##")) { $helpEnd = $lineNumber; break; } } $output = join(array_slice($readme, 0, $helpStart + 1)); $output .= "\n " . implode("\n ", $help) . "\n"; $output .= join(array_slice($readme, $helpEnd)); file_put_contents("README.md", $output); } function run_mv() { exec('cp ./bin/md2resume ~/bin/md2resume'); } /* End of pakefile */