zowe / zowe-common-c

C Libraries for various OS & Networking needs
Eclipse Public License 2.0
10 stars 30 forks source link

Embedded JS: colon in string is a game changer #456

Closed Martin-Zeithaml closed 5 months ago

Martin-Zeithaml commented 5 months ago

Let's define zowe.yaml as:

zowe:
  environments:
    test: ${{ "A B" }}

Run command to get value of zowe.environments.test:

zowe/runtime/2.16.0/bin/zwe config get -c ./zowe.yaml --path '.zowe.environments.test'
Temporary directory '/tmp/.zweenv-780' created.
Zowe will remove it on success, but if zwe exits with a non-zero code manual cleanup would be needed.
A B
Temporary directory /tmp/.zweenv-780 removed successfully.

Modify zowe.yaml, add colon inside the string:

zowe:
  environments:
    test: ${{ "A: B" }}
ZWEL0318E - Couldn't scan file '/zowe.yaml': mapping values are not allowed in this context at line 3, column 19.
Error: Could not load config for FILE(/zowe.yaml), status=2

Note:

Ugly workaround:

zowe:
  environments:
    colon: ':'
    test: ${{ 'A' + zowe.environments.colon + ' B' }}

Do not ask:

1000TurquoisePogs commented 5 months ago

Have you tried "${{ 'A: B' }}"

Martin-Zeithaml commented 5 months ago

Yes, of course, I forgot the double quotes.