local: not in a function
Closed this issue · 1 comments
Try to run sh scripts/init.sh
and got this bug.
root@Sky:/mnt/c/Users/sky/Documents/GitHub/rollapp-evm# sh scripts/init.sh : not foundt.sh: 4: scripts/init.sh: 6: local: not in a function
To Reproduce
- Go to
https://github.com/dymensionxyz/rollapp-evm
- Click
Open With Desktop Github
- Click
Open in Visual Studio Code
- Run
make install
- Copy all the variables
- Run
sh scripts/init.sh
Expected behavior
It is expected to run the scripts/init.sh
successfully.
Desktop (please complete the following information):
- go version: go version go1.22.1 linux/amd64
- Ubuntu 22.04.4 LTS in WSL2
Additional context
The : not foundt.sh: 4:
error can be eliminated just deleting the one empty bar. However, scripts/init.sh: 6: local: not in a function
mentioned my local is not in a function but instead, there are {
in line 5 and }
in line 24.
I supposed rollapp is not supported in window so I am using Ubuntu in WSL2. I also demand a tutorial on how to set up in docker so I can spin this up fast. Thanks a lot.
I solved it. it is because CRLF and LF issue (EOL issue)
https://stackoverflow.com/questions/18155852/syntax-error-end-of-file-unexpected-expecting-then
https://stackoverflow.com/questions/48692741/how-can-i-make-all-line-endings-eols-in-all-files-in-visual-studio-code-unix
dropping my reference here in case anyone face this same issue.