Giter Club home page Giter Club logo

normalize-filenames's Introduction

normalize-filenames

A quick-and-dirty Ruby script to perform Unicode Normalization on filesystem paths

Install

Download, mark as executable, and run from the command line

curl -fsSLO https://github.com/jarrodldavis/normalize-filenames/raw/master/normalize-filenames
chmod +x ./normalize-filenames
./normalize-filenames

Usage

Usage:
  normalize-filenames unicode PATH -g, --glyph-preservation=PRESERVATION_TYPE -o, --operation=OPERATION

Options:
  -g, --glyph-preservation=PRESERVATION_TYPE  # Whether to preserve glyphs or replace applicable glyphs with compatibility characters
                                              # Default: canonical
                                              # Possible values: canonical, compatibility
  -o, --operation=OPERATION                   # Whether to compose Unicode grapheme clusters into single code points, or decompose them into multi-code-point sequneces
                                              # Default: compose
                                              # Possible values: compose, decompose
  -v, [--verbose], [--no-verbose]             # Print verbose output of every file and folder visited

Perform Unicode normalization on filenames in PATH

Examples

# normalize all filesystem paths in the current directory to NFC (Composed, Canonical) Form
./normalize-filenames unicode .
# normalize all filesystem paths in the current directory to NFD (Decomposed, Canonical) Form
./normalize-filenames unicode . -o decompose
# normalize all filesystem paths in the current directory to NFKC (Composed, Compatibiltiy) Form
./normalize-filenames unicode . -g compatibility
# normalize all filesystem paths in the current directory to NFKD (Decomposed, Compatibiltiy) Form
./normalize-filenames unicode . -o decompose -g compatibility
# normalize all filesystem paths in the `photos` folder of the current directory to NFC (Composed, Canonical) Form
./normalize-filenames unicode ./photos

normalize-filenames's People

Contributors

jarrodldavis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

normalize-filenames's Issues

Summary by default

You know what would be awesome? If the script gave you a summary of what it did and didn't do even without the verbose flag. Something like one of these:

  • no files found to normalize
  • X files normalized

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.