ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Improve `shExec` function implementation in `ckeditor5-dev`.

Open martnpaneq opened this issue 1 year ago • 1 comments

📝 Provide a description of the improvement

Improve shExec implementation in ckeditor5-dev: https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-utils/lib/tools.js#L25

This function is used to execute sh commands in ckeditor5 ecosystem. Right now it has ~50 lines of code, and after adding async support, it would reach ~80 lines. With the current complexity, it's hard to modify and it's easy to introduce unexpected bugs.

Task description

  1. Simplify the shExec function implementation.
  2. When refactoring the function, make sure that the behaviour stays the same.

[Bonus] Consider splitting the sync and async versions into two separate functions, following the node tools convention: exec and execSync.

📃 Other details

  • Browser: …
  • OS: …
  • CKEditor version: …
  • Installed CKEditor plugins: …

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

martnpaneq avatar May 18 '23 13:05 martnpaneq