flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

Problem with line-end format with latest beta 6 version #138

Open edbzn opened 2 years ago

edbzn commented 2 years ago

After upgrading to 5.0.0-beta.6, my command running yarn api-client-generator does not work anymore, I get the following output:

/usr/bin/env: ‘node\r’: No such file or directory
error Command failed with exit code 127.

I think it's an issue related to the line-end format that was just changed to LF (which is good) but somehow not entirely, some DOS format seems to be present. If I transform all the files to LF using dos2unix before running api-client-generator then it works:

yarn run v1.22.5
$ /app/node_modules/.bin/rimraf 'libs/shared/_generated/api/src/lib/!(.gitignore|index.ts)'
Done in 0.10s.
dos2unix: converting file /app/node_modules/api-client-generator/dist/generator.js to Unix format...
dos2unix: converting file /app/node_modules/api-client-generator/dist/git.js to Unix format...
dos2unix: converting file /app/node_modules/api-client-generator/dist/helper.js to Unix format...
dos2unix: converting file /app/node_modules/api-client-generator/dist/main.js to Unix format...
dos2unix: converting file /app/node_modules/api-client-generator/dist/parser.js to Unix format...
dos2unix: converting file /app/node_modules/api-client-generator/dist/types.js to Unix format...
yarn run v1.22.5
$ /app/node_modules/.bin/api-client-generator -t all -s tools/data/swagger.json -o libs/shared/_generated/api/src/lib
Angular API client generated successfully
Done in 0.57s.
vmasek commented 2 years ago

thanks for the report, I'll have a look at what could be the problem, I forced the LF for the repo as there were mixed EOL so it is most probably connected