matan-h / adb-shell

better `adb shell`

Repository from Github https://github.commatan-h/adb-shellRepository from Github https://github.commatan-h/adb-shell

sh: /sdcard/.adb/startup.sh[66]: syntax error: unmatched 'if'

The-MAZZTer opened this issue · comments

Error messages:

D:\Repos\adb-shell>powershell -executionpolicy bypass -file .\adb-shell.ps1
file not found, push with adb
D:\Repos\adb-shell/startup.sh: 1 file pushed, 0 skipped. 7.7 MB/s (1804 bytes in 0.000s)
: inaccessible or not found[3]:
: inaccessible or not found[7]:
: inaccessible or not found[13]:
sh: /sdcard/.adb/startup.sh[66]: syntax error: unmatched 'if'
$

It looks like when git cloning on Windows you will of course get CRLF line endings which apparently Android HATES in startup.sh. This should be mentioned in the readme and a workaround or solution provided (I used Visual Studio Code to change the line endings).

As you mention this error is apparently from CR/LF bytes with git clone on Windows. I should update the git clone command to be with git clone -c core.autocrlf=false (I found this in so:50974005)

I think you can also configure github settings for your repo to tell it not to change line endings for specific file types in your repo as well. That's probably a better option.

I cannot find such option in my repo settings, nor I can find any hint for that on the internet. What you posted is not a GitHub option, it's a git config option.

Sorry, wrong link, updated.

Oh, you mean .gitattributes file! It's not a GitHub setting, but I agree. It's should be better

Ok. I can verify its working for me, both with core.autocrlf=true and core.autocrlf=false