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
| # Reanme the files to start with a capital letter and end with a 2, | |
| # see https://stackoverflow.com/questions/3011625/git-mv-and-only-change-case-of-directory | |
| for f in *; do git mv --force "./$f" "./${(C)f[1]}${f[2,-1]}2"; done | |
| # Remove the 2 | |
| for f in *; do git mv --force "./$f" "./${f%?}"; done |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!