Created
November 6, 2018 16:52
-
-
Save GuyPaddock/fff39cae35dfb57e0253aaa36f28893d to your computer and use it in GitHub Desktop.
2017-10-19 - Render PHP Files to HTML in Bulk through CLI
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
#!/bin/env bash | |
for f in $(find . -maxdepth 1 -name '*.php'); do | |
directory=$(dirname "${f}"); | |
basename=${f%.*} | |
mkdir -p "../rendered/${directory}"; | |
php -f "${f}" > "../rendered/${basename}.html"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment