Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codemod failure on windows due to too many files on argument list #1054

Open
Kilowhisky opened this issue Jul 2, 2020 · 2 comments
Open

Comments

@Kilowhisky
Copy link

Kilowhisky commented Jul 2, 2020

When running the --run-codemod command in windows command line on a large project the resulting command line is larger than the maximum allowed command length.

For instance my project has several hundred routes and several hundred components and managed to generate a file list that was 38,480 characters long.

Here is just the output from the beginning of the command.

? These codemods apply to your project. Select which ones to run. cp-property-codemod
Running codemod cp-property-codemod
Running command 1 of 1
  boilerplate-update npx ember-3x-codemods cp-property app/**/*.js +0ms
npx: installed 421 in 22.201s
(node:6072) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 38 (ENAMETOOLONG): C:\Users\kilowhisky\AppData\Roaming\npm-cache\_npx\6072\node_modules\ember-3x-codemods\node_modules\jscodeshift\bin\jscodeshift.js -t C:\Users\kilowhisky\AppData\Roaming\npm-cache\_npx\6072\node_modules\ember-3x-codemods\transforms\cp-property\index.js --extensions js,ts app/app.js app/formats.js app/router.js

.... 38k more characters of file list.

It doesn't seem to be a problem when running it under WSL.

@darrenw-npi
Copy link

Same here. Not tried it on WSL yet though. Be good if there was a way to split the codemods into chunks...

@darrenw-npi
Copy link

For anybody else who get this, I think I was able to workaround this by running the following command:
npx github:ember-codemods/es5-getter-ember-codemod es5-getter-ember-codemod app/**/*.js

See https://github.com/ember-codemods/es5-getter-ember-codemod?tab=readme-ov-file#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants