Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./bootstrap.sh throws error #19

Open
julianvogels opened this issue Mar 14, 2019 · 3 comments
Open

./bootstrap.sh throws error #19

julianvogels opened this issue Mar 14, 2019 · 3 comments

Comments

@julianvogels
Copy link

julianvogels commented Mar 14, 2019

When running ./bootstrap.sh on a fresh clone, this error is produced:

julianvogels:dimple (master) $ ./bootstrap.sh
: command not founde 4:
: command not founde 7:
This script bootstraps required libraries for selected environments.
: command not founde 9:
: command not founde 11:
'/bootstrap.sh: line 12: syntax error near unexpected token `{
'/bootstrap.sh: line 12: `liblo() {

System:

Model Name: MacBook Pro
Model Identifier: MacBookPro13,3
Processor Name: Intel Core i7
Processor Speed: 2.7 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 16 GB
Boot ROM Version: 251.0.0.0.0
SMC Version (system): 2.38f7

macOS 10.14.3 Mojave

@radarsat1
Copy link
Owner

So it was missing a hashbang and so if you were running it from zsh maybe it was not the correct syntax. Current master should force it to run as a bash script. Otherwise you could try running it as "bash bootstrap.sh"

@julianvogels
Copy link
Author

I tried "bash bootstrap.sh" after pulling the latest code. Got a very similar error:

julianvogels:dimple (master) $ bash bootstrap.sh
: command not found2:
: command not found6:
: command not found9:
This script bootstraps required libraries for selected environments.
: command not found11:
: command not found13:
: command not found16:
'ootstrap.sh: line 66: syntax error near unexpected token `{
'ootstrap.sh: line 66: `liblo() {

I get the same when running from iTerm (zsh) or Terminal. But tbh Im not a terminal wizard so maybe something could be wrong with my .zshrc or my .bash_profile?

@radarsat1
Copy link
Owner

Weird, I think this must be a problem with your git checkout. After seeing that it's complaining about "command not found" on empty lines, on a hunch I tried the following and got similar errors to you:

$ unix2dos bootstrap.sh 
unix2dos: converting file bootstrap.sh to DOS format...

$ bash bootstrap.sh 
bootstrap.sh: line 2: $'\r': command not found
bootstrap.sh: line 6: $'\r': command not found
bootstrap.sh: line 9: $'\r': command not found
This script bootstraps required libraries for selected environments.
bootstrap.sh: line 11: $'\r': command not found
bootstrap.sh: line 13: $'\r': command not found
bootstrap.sh: line 16: $'\r': command not found
bootstrap.sh: line 66: syntax error near unexpected token `$'{\r''
'ootstrap.sh: line 66: `liblo() {

so it seems that your git checkout has the wrong line endings (should be unix LF format, but git is converting it to CRLF). Any reason on your system that would happen? It's usually a Windows problem, not mac, so it's surprising. Does your git configuration have auto.crlf set?

$ git config --get auto.crlf

Does the script work for you if you change the line endings to unix?

$ dos2unix bootstrap.sh
$ bash bootstrap.sh

You'll need dos2unix installed (eg via homebrew) of course.. otherwise you can try,

$ tr -d '\r' < bootstrap.sh >fixed.sh

instead.

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

No branches or pull requests

2 participants