postmodern/chruby

`setup.sh` script is broken on WSL2 Ubuntu 20.04

kevinfiol opened this issue · 1 comments

Description

Running the setup.sh script in the repo breaks using Ubuntu 20.04 on WSL2.

A quick google search shows that this has to do with the setup.sh script having Windows-style line endings \r\n. After running sed $'s/\r$//' on the setup.sh script, I was able to execute it as normal, however, the resulting /usr/local/share/chruby/auto.sh and /usr/local/share/chruby/chruby.sh had the same issue. After using the above sed command on both scripts did chruby finally behave as expected.

Steps To Reproduce

Steps to reproduce the bug:

  1. Clone repository
  2. Run sudo ./scripts/setup.sh as seen in the README

Expected Behavior

The setup script should run as normal

Actual Behavior

/usr/bin/env: ‘bash\r’: No such file or directory

Environment

$ bash --version
`GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)`

Closing this. This was an error on my part, found out when I had the same issue with another project.

Warning to anyone in the future: be careful with your gitconfig. In my case, I had autocrlf = true, which was converting LFs to CRLFs when I would clone repositories.