overhangio / tutor-indigo

An elegant, customizable theme for Open edX
GNU Affero General Public License v3.0
74 stars 276 forks source link

docs: recommend nested quotes for setting primary color #45

Closed kdmccormick closed 1 year ago

kdmccormick commented 1 year ago

In Tutor 16.0.2 in zsh, this command:

tutor config save --set "INDIGO_PRIMARY_COLOR=#225522"

will set INDIGO_PRIMARY_COLOR to null in config.yml. The same is true if double-quotes are used. If one wraps the color in additional set of quotes, though, then INDIGO_PRIMARY_COLOR is set without any issues.

I believe this is due to how the # is handled when rendering config.yml, but I haven't been able to dig into Tutor and confirm that. For now, I propose adding this example to this README in hope that it'll stop anyone from getting stuck on the # issue.

kdmccormick commented 1 year ago

I'm not quite sure about that. In bash:

$ echo A=#123 #hello
A=#123

$ echo 'A=#123' #hello
A=#123

$ echo "A=#123" #hello
A=#123

$ echo "A= #123" #hello
A= #123

$ echo A= #123 #hello
A=

That is, # only seems to begin a comment if it outside of quotes and is prefixed with a space (or other delimiter, I imagine).

regisb commented 1 year ago

OMG you're right! It's actually the yaml parser from Tutor that interprets the pound character as a comment prefix :exploding_head:

kdmccormick commented 1 year ago

Phew, I'm glad I'm not crazy :) I opened https://github.com/overhangio/tutor/issues/866 to track this.