cookie
cookie copied to clipboard
Spaces in variables produce errors.
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 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.
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.
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.
Reopening this issue until I have time to test #28.