Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Error while compiling 0.2.1 #5

Open
StanHVA opened this issue Mar 30, 2017 · 2 comments
Open

Error while compiling 0.2.1 #5

StanHVA opened this issue Mar 30, 2017 · 2 comments

Comments

@StanHVA
Copy link

StanHVA commented Mar 30, 2017

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?

@xsc
Copy link
Owner

xsc commented Mar 31, 2017

@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.

@StanHVA
Copy link
Author

StanHVA commented Apr 3, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants