0.0.2 • Published 8 years ago

each-cli v0.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

each-cli

CLI utility to execute a command for each glob matching file.

Examples:

Visit each .tar file (setting the directory to its location) and untar:

each '**/*.tar' -- tar xvf %f

Convert all .jpg images to .png

each '**/*.jpg' -- convert %b.jpg %b.png

See the main --help page for more information.

Installation

npm install -g each-cli

Command expansion

Commands can be written in a varity of ways. Each of the below tokens gets expanded into the value shown.

TokenExampleDescription
%fmyfile.fooFile name
%p/foo/bar/baz/myfile.fooFile path
%bmyfileFile name without extension
%efooFile extension
{{name}}myfile.fooFile name
{{path}}/foo/bar/baz/myfile.fooFile path
{{dir}}/foo/bar/bazThe dir portion of the full path
{{base}}myfileFile name without extension
{{basename}}myfileFile name without extension
{{ext}}fooFile extension