Last active
February 28, 2020 18:47
-
-
Save mctaylorpants/04ceca3d4d0f7230c191d39e6462b4e5 to your computer and use it in GitHub Desktop.
Modify case-sensitive filenames on macOS
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
#!/usr/bin/env ruby | |
# Converts all characters in a filename to lowercase on macOS, where by default | |
# the filesystem is case-insensitive. | |
# Usage: | |
# Pass a glob pattern to the script: | |
# ruby downcase_filenames.rb spec/cassettes/**/*.yml | |
begin | |
`git config core.ignorecase false` | |
Dir[ARGV[0]].each do |cassette_file| | |
downcased_file = cassette_file.downcase | |
`git mv --force #{cassette_file} #{downcased_file}` | |
end | |
ensure | |
`git config core.ignorecase true` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment