Last active
February 12, 2017 03:35
-
-
Save viniciusCamargo/bc2fabd6bcd06c6f12c8a0c9e5224598 to your computer and use it in GitHub Desktop.
Change file extension on the current directory from PHP to HTML
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
const fs = require('fs') | |
const cwd = process.cwd() | |
fs.readdir(cwd, 'utf8', (err, files) => { | |
if (err) | |
throw err | |
files.map(f => fs.rename(f, f.replace('php', 'html'), (err, file) => { | |
if (err) | |
throw err | |
})) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment