Skip to content

Instantly share code, notes, and snippets.

@JadenH
Created December 14, 2019 20:32
Show Gist options
  • Save JadenH/d185e48b37b929432ee043110aba5424 to your computer and use it in GitHub Desktop.
Save JadenH/d185e48b37b929432ee043110aba5424 to your computer and use it in GitHub Desktop.
Recursively rename filenames from kebab case to pascal case
#!/bin/bash
files=$(find src -name '*.ts' -or -name '*.tsx')
for file in $files; do
path=$(dirname "$file")
filename=$(basename "$file" | sed -r 's/(-)([a-z])/\U\2/g')
mv "$file" "$path/$filename"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment