Skip to content

merge-i18n script does not work with npm #4211

@alanorth

Description

@alanorth

Describe the bug

After switching from yarn to npm in #3173 the merge-i18n script no longer works.

To Reproduce

Steps to reproduce the behavior:

$ npm run merge-i18n -s src/themes/custom/assets/i18n 
Source or Output parameter is missing.
Usage: merge-i18n-files.ts (-s <source-dir> [-d <output-dir>])

Options:
  -v, --version                  output the version number
  -d, --output-dir <output-dir>  output dir when running script on all language files (default: "/home/aorth/src/git/dspace-angular/src/assets/i18n")
  -s, --source-dir <source-dir>  source dir of translations to be merged
  -h, --help                     output usage information
undefined

It seems that npm is consuming the command line arguments, as it works if we tell the shell to stop processing arguments using --:

$ npm run merge-i18n -- -s src/themes/custom/assets/i18n

> [email protected] merge-i18n
> ts-node --project ./tsconfig.ts-node.json scripts/merge-i18n-files.ts -s src/themes/custom/assets/i18n

Merging: /home/aorth/src/git/dspace-angular/src/assets/i18n/en.json5 with src/themes/custom/assets/i18n/en.json5
 ████████████████████████████████████████ 100% | ETA: 0s | 100/100

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects: mainIssue impacts "main" (latest release).bugi18n / l10nInternationalisation and localisation, related to message catalogstestathonReported by a tester during Community Testathon

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions