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

fix opening of files provided with --config-path #88

Merged
merged 1 commit into from
Oct 8, 2023
Merged

fix opening of files provided with --config-path #88

merged 1 commit into from
Oct 8, 2023

Conversation

Rogdham
Copy link
Contributor

@Rogdham Rogdham commented Oct 8, 2023

Hello, when using --config-path option, ini.parse fails to parse the file as fs.readFileSync returns a Buffer and not a string.

/redacted/locize-cli/node_modules/ini/lib/ini.js:72
  const lines = str.split(/[\r\n]+/g)
                    ^

TypeError: str.split is not a function
    at Object.decode (/redacted/locize-cli/node_modules/ini/lib/ini.js:72:21)
    at Command.<anonymous> (/redacted/locize-cli/bin/locize:688:20)
    at Command.listener [as _actionHandler] (/redacted/locize-cli/node_modules/commander/lib/command.js:482:17)
    at /redacted/locize-cli/node_modules/commander/lib/command.js:1283:65
    at Command._chainOrCall (/redacted/locize-cli/node_modules/commander/lib/command.js:1177:12)
    at Command._parseCommand (/redacted/locize-cli/node_modules/commander/lib/command.js:1283:27)
    at /redacted/locize-cli/node_modules/commander/lib/command.js:1081:27
    at Command._chainOrCall (/redacted/locize-cli/node_modules/commander/lib/command.js:1177:12)
    at Command._dispatchSubcommand (/redacted/locize-cli/node_modules/commander/lib/command.js:1077:23)
    at Command._parseCommand (/redacted/locize-cli/node_modules/commander/lib/command.js:1248:19)

Note that the above stacktrace is silenced by the try-catch, making it all the more confusing.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • documentation is changed or added

@adrai adrai merged commit 83ad426 into locize:master Oct 8, 2023
1 check passed
@Rogdham Rogdham deleted the fix-custom-config-file branch October 8, 2023 14:59
@adrai
Copy link
Collaborator

adrai commented Oct 8, 2023

Thank you.
It's included in v7.14.10

@Rogdham
Copy link
Contributor Author

Rogdham commented Oct 8, 2023

Damn, you are very fast!

Many thanks, this is much appreciated.

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

Successfully merging this pull request may close these issues.

2 participants