wp-pot / wp-pot-cli

Run wp-pot script via cli
MIT License
37 stars 5 forks source link

wp-pot : email in options causes script in package.json to fail #256

Open IonTulbure opened 1 year ago

IonTulbure commented 1 year ago

Describe the bug I am using this Wordpress Plugin Boilerplate https://github.com/wp-strap/wordpress-plugin-boilerplate .

package.json has this translate script based on wp-pot:

"translate": "wp-pot --src '**/**/**/*.php' --dest-file 'languages/test-plugin.pot' --package 'test-plugin' --domain 'test-plugin' --last-translator 'Test Plugin <info@testplugin.com>' --team 'Test Plugin <info@testplugin.com>' --bug-report 'testplugin.com'"

When i run yarn translate i get the following error:

yarn run v1.22.19 $ wp-pot --src '**/**/**/*.php' --dest-file 'languages/test-plugin.pot' --package 'test-plugin' --domain 'test-plugin' --last-translator 'Test Plugin <info@testplugin.com>' --team 'Test Plugin <info@testplugin.com>' --bug-report 'testplugin.com' The system cannot find the file specified. error Command failed with exit code 1.

To Reproduce run yarn translate (wp-pot)

This will throw the following error: The system cannot find the file specified. error Command failed with exit code 1.

Module versions └─┬ wp-pot-cli@1.5.0 └─┬ wp-pot@1.10.2 └── php-parser@3.1.2

Additional context What can cause this issue, can't find anything related to it.

Without email (<email@mail.com> for example) in --teams & --last-translator options it works :
translate": "wp-pot --src '**/**/**/*.php' --dest-file 'languages/test-plugin.pot' --package 'test-plugin' --domain 'test-plugin' --bug-report 'testplugin.com' --team 'Test Plugin' --last-translator 'Test Plugin'"

IonTulbure commented 1 year ago

@rasmusbe Hi, sorry for disturbing. Can you help ?

"translate": "wp-pot --src '**/**/**/*.php' --dest-file 'languages/test-plugin.pot' --package 'test-plugin' --domain 'test-plugin' --bug-report 'testplugin.com' --team 'Test Plugin \"<info@testplugin.com>\"' --last-translator 'Test Plugin \"<info@testplugin.com>\"'" - this works.

Do we need to escape less and greater signs < & > in order to use email in --team & --last-translator for use in package.json script ?