ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

Install on WSL - error line 2 of .bashrc syntax error near unexpected token `$'in\r'' #496

Open MrTortoise opened 7 months ago

MrTortoise commented 7 months ago

local reproduction steps:

cp /etc/skel/.bashrc ~/
source .bashrc
rm -rf ~/.oh-my-bash
bash -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh -O -)"

output is

                        /____/                            .... is now installed!
Please look over the ~/.bashrc file to select a theme, plugins, completions, aliases, and options
To keep up on the latest news and updates, follow us on GitHub: https://github.com/ohmybash/oh-my-bash
bash: /home/john/.bashrc: line 2: syntax error near unexpected token `$'in\r''
'ash: /home/john/.bashrc: line 2: `case $- in

confused and googling hasn't helped.

Last time i did this all was fine. So slightly confused.

thanks

akinomyoga commented 7 months ago

What is the result of the following command?

$ type -a wget
MrTortoise commented 7 months ago
wget is /usr/bin/wget
wget is /bin/wget

sorry for delay! updated question to clarify more

akinomyoga commented 7 months ago

I have again looked at the error message, and I think I now know what is happening. This must be the same issue as #253 and #327. You should set the following git configuration before installing OMB.

$ git config --global core.autocrlf false