https://github.com/agilecreativity/folders_renamer
Bulk cleanup/rename folder names to replace special characters with a specific string (recursively)
https://github.com/agilecreativity/folders_renamer
Last synced: over 1 year ago
JSON representation
Bulk cleanup/rename folder names to replace special characters with a specific string (recursively)
- Host: GitHub
- URL: https://github.com/agilecreativity/folders_renamer
- Owner: agilecreativity
- License: mit
- Created: 2014-05-06T01:34:52.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-03-17T12:54:34.000Z (over 8 years ago)
- Last Synced: 2025-03-30T05:01:57.244Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## folders_renamer
[][gem]
[][gemnasium]
[][codeclimate]
[][travis-ci]
[gem]: http://badge.fury.io/rb/folders_renamer
[gemnasium]: https://gemnasium.com/agilecreativity/folders_renamer
[codeclimate]: https://codeclimate.com/github/agilecreativity/folders_renamer
[travis-ci]: https://travis-ci.org/agilecreativity/folders_renamer
Rename/cleanup folder names using the simple rules. For optimal result you may like
also like to try my [filename_cleaner][] gem which clean/rename the bad file names.
Features
--------
- Rename directory recursively from any starting location
- Replace unwanted characters with value of your choice using `--sep-string` option (default to . (dot))
- Following the [Semantic Versioning][] for release schedule
- Quickly rename bad folder names to good folder names with one command.
TL;DR;
-----
Turn these directories (if your OS allow you to have these names)
```
some_folder/
├── aa!@#$!01
│ └── bb#@#$@#$@01
├── aa**#$@#$#@$aa
└── bb$@#$#@$@#bb
└── cc#$!#$@#cc!!!
```
into these directories
```
some_folder/
├── aa_01
│ └── bb_01
├── aa_aa
└── bb_bb
└── cc_cc
```
using command like:
```sh
cd ~/path/to/some_folder/
# Perform the dry-run to see what will be changed (no changes)
folders_renamer --sep-string _
# Commit your changes
folders_renamer --sep-string _ --commit
```
### Installation
```sh
gem install folders_renamer
```
### Usage/Synopsis
Type the `folders_renamer` without any options, which will give the following output
```
Usage:
folders_renamer -b, --base-dir=BASE_DIR -s, --sep-string=SEP_STRING
Options:
-b, --base-dir=BASE_DIR # Starting directory
# Default: . (current directory)
-s, --sep-string=SEP_STRING # Separtor string to use
# Default: .
-c, [--commit], [--no-commit] # Commit your changes (defalt --no-commit)
-v, [--version=VERSION] # Display version number
Cleanup and rename folders
```
### Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
[Semantic Versioning]: http://semver.org
[filename_cleaner]: http://rubygems.org/gems/filename_cleaner