Skip to content

bug: cmdline args need jsonification; tty support needs adjustment#27

Merged
kvaps merged 1 commit intokvaps:masterfrom
joesuf4:jsonify-entrypoint
Jun 14, 2021
Merged

bug: cmdline args need jsonification; tty support needs adjustment#27
kvaps merged 1 commit intokvaps:masterfrom
joesuf4:jsonify-entrypoint

Conversation

@joesuf4
Copy link
Contributor

@joesuf4 joesuf4 commented May 29, 2021

  • switch shell to bash so we can use arrays and bulk element transforms
  • use [ -t 0 ] to baseline whether we need terminal support for the invocation
@joesuf4 joesuf4 force-pushed the jsonify-entrypoint branch 2 times, most recently from 3f4b412 to 8fca66b Compare May 29, 2021 20:15
- switch shell to bash so we can use arrays and bulk element transforms - use [ -t 0 ] to baseline whether we need terminal support for the invocation - send human-interest commentary to stderr instead of stdout
@joesuf4 joesuf4 force-pushed the jsonify-entrypoint branch from 8fca66b to 9df9374 Compare June 2, 2021 14:45
@joesuf4
Copy link
Contributor Author

joesuf4 commented Jun 2, 2021

The motivation for this patch is that I want to use node-shell in CLI pipelines, so I am not interested in the default tty login shell API.

I don't want "stuff" printed to stdout unless I'm expecting it from my CLI invocation, so I redirect that output to stderr. Also I have embedded newlines and double-quote characters in some of my CLI tooling that wraps node-shell, so I need better CLI->json-string translation than before I needed now.

@kvaps
Copy link
Owner

kvaps commented Jun 4, 2021

Hi thank you for your PR, I'll review it in a while 👍

Copy link
Owner

@kvaps kvaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @joesuf4, sorry for late reply.
Your PR adds two new dependencies bash and sed.

I agree that using bash arrays makes it more convenient, but the original goal for this plugin was to keep it simplest and compatible with all possible architectures and any shell.

I believe that there is no reasons to upgrade shell version. Please take a look on these changes, I think I was able to make your changes compatible with standard bourne shell

Copy link
Contributor Author

@joesuf4 joesuf4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we agreed on this MR?

@joesuf4
Copy link
Contributor Author

joesuf4 commented Jun 10, 2021

Ok.

@joesuf4 joesuf4 closed this Jun 10, 2021
@joesuf4 joesuf4 reopened this Jun 10, 2021
@joesuf4
Copy link
Contributor Author

joesuf4 commented Jun 10, 2021

Fighting with GitHub MR ui. Bear with me.

@kvaps kvaps merged commit 6da560b into kvaps:master Jun 14, 2021
@kvaps
Copy link
Owner

kvaps commented Jun 14, 2021

Merged in v1.4.0.
Many thanks for your contribution!

@joesuf4 joesuf4 deleted the jsonify-entrypoint branch June 19, 2021 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants