Remeber to use git config core.ignorecase false
while you are on case insensitive partition
Created
May 19, 2018 11:46
-
-
Save Igloczek/a87823e6f6782e4e87bb794d2ab7b285 to your computer and use it in GitHub Desktop.
Quick way to capitalize bunch of file names
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
{ | |
"dependencies": { | |
"glob": "*" | |
} | |
} |
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
const fs = require('fs') | |
const glob = require('glob') | |
function capitalizeFirstLetter(string) { | |
return string.charAt(0).toUpperCase() + string.slice(1); | |
} | |
glob('core/components/**/*.js', (temp, files) => { | |
files.forEach(file => { | |
const name = file.match(/\w+\.js$/)[0] | |
fs.renameSync( | |
file, | |
file.replace(name, capitalizeFirstLetter(name)) | |
) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment