Error while compiling 0.2.1
Hi, I'm using: bashing 0.2.1 (bash 4.3.11(1)-release) And I'm encountering the following issue when following the standard tutorial found here. When I follow the tutorial, hence make the file %docroot%/src/lib/print.sh and %docroot%/src/tasks/hello.sh I'm receiving the following error:
$ bashing run hello
bash: line 19: syntax error: unexpected end of file
I checked to see if I made any mistakes. Here are my files: %docroot%/src/lib/print.sh
#!/bin/bash
function printGreeting() {
local g="$1"
local r="$2"
echo "${g}, ${r}!"
}
and %docroot%/src/tasks/hello.sh
#!/bin/bash
printGreeting "Hello" "$1"
So this seems correct to me. When running bashing uberbash it creates the following code:
[...]
export __GROUP_ID='file'
function printGreeting() {
local g="$1"
local r="$2"
echo "${g}, ${r}!"
function cli_hello() {
[...]
It seems like it forgets a bracket at the end of the function created. I added this bracket manually and the program runs. Did I do anything wrong? Or is there a mistake in the program?
@StanHVA I haven't had a lot of contact with this tool for a few years now, so I'm not exactly sure where to start looking. Chances are you're using a version of one of the underlying tools (e.g. sed, grep, ...) that behaves differently than what bashing expects.
Can you add the following line to the beginning of hello.sh and print.sh (after #!/bin/bash):
# <plain>true</plain>
This, if I understand my own code correctly, should prevent changes to the input file (like removing empty lines, indentation, ...), so maybe that helps.
Thanks a lot for your response. I've tried this but unfortunately this didn't resole the problem. Ironically, I've tried the framework on the new bash emulator that's built-in windows, and it worked perfectly there. It probably has to do with limitations on my workstation (at my workplace) or indeed a different install of sed/grep.