Last active
May 3, 2021 16:53
-
-
Save oxr463/656080bf1a63455b2e644d201224e1cb to your computer and use it in GitHub Desktop.
Lowercase all file names in git repository
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
#!/bin/sh | |
# Lowercase all file names in git repository | |
# SPDX-License-Identifier: 0BSD | |
# FIXME: recurse subdirectories | |
for file in *; do | |
lowercase_name=$(echo $file | awk '{ print tolower($0) }') | |
# https://stackoverflow.com/a/30654833/8507637 | |
git mv "${file}" "_${lowercase_name}" | |
git mv "_${lowercase_name}" "${lowercase_name}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment