ewanharris / titanium-codemods

Codemod scripts for Titanium Applications
10 stars 2 forks source link

command line example #6

Closed raybelisle closed 4 years ago

raybelisle commented 5 years ago

I have been trying to run the codemods, but keep getting a unknown command error, regardless of the command line I use. I was trying to understand the command line requirements by looking at this file cli/commands/run.js but to no avail.

Do you have an example of calling this code?

I have tried: npx titanium-codemods /Users/raybelisle/Documents/appcelerator\ projects/name_of_project --transforms setter-deprecation --dry-run

npx titanium-codemods --transforms setter-deprecation --dry-run

npx titanium-codemods setter-deprecation --dry-run

npx titanium-codemods setter-deprecation

all I get is the Unknown Command error...

ewanharris commented 5 years ago

Thanks for the issue @raybelisle.

I've just updated the docs to hopefully make this clearer https://github.com/ewanharris/titanium-codemods#usage

To run the transforms you can run npx titanium-codemods run --dry-run in your project directory, it'll prompt to select them and log the changes to the console. Note that the output might look a little odd (After is -, Before is +), I think jest-diff has opened up their usage more so I should be able to make that more intuitive.