cookie icon indicating copy to clipboard operation
cookie copied to clipboard

Spaces in variables produce errors.

Open magpie514 opened this issue 5 years ago • 4 comments

I was testing out cookie to see what I could do with it and after a few tests I accidentally left a variable name with spaces which caused a bad substitution error. '''

Initializing the './/doc.sh' script. DATE: /home/magpie/.local/bin/cookie: line 384: ${{Script Name}}: bad substitution {{Script Name}}: '''

This is in Ubuntu 19.04, bash 5.0.3, and current master for cookie. While it's not unusual for variables to require no spaces it'd be good to have a failsafe in place.

magpie514 avatar May 22 '19 04:05 magpie514

@magpie514 Thanks for submitting this. While not an unreasonable request by any means, I don't personally agree with this. I think it falls into the category of trying to catch an exception that you can't really handle. Moreover, a slightly better error message doesn't warrant the added complexity in my opinion.

bbugyi200 avatar Jun 01 '19 21:06 bbugyi200

Fair enough. It was meant less as a request and more of a potential area of error (after all I triggered it by mistake, I was meaning to input a _ but fumbled it somehow), but I find it's a reasonable decision since it shouldn't happen unless there's user error.

magpie514 avatar Jun 02 '19 23:06 magpie514

This is most definitely still a bug, even if the suggested solution wasn't satisfactory. I have encountered the same bug (it's rather easy, just enter more than one word for any template value). I have a pull request ready which will fix this bug. I will check the contributing docs first to see if you require issues be submitted before pull requests.

hardyoyo avatar Jan 09 '22 19:01 hardyoyo

Reopening this issue until I have time to test #28.

bbugyi200 avatar Jan 10 '22 14:01 bbugyi200