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

Fresh install results in bash $'\r': command not found error #4675

Open
antsoftwaredev opened this issue Nov 9, 2023 · 4 comments
Open

Fresh install results in bash $'\r': command not found error #4675

antsoftwaredev opened this issue Nov 9, 2023 · 4 comments
Labels

Comments

@antsoftwaredev
Copy link

antsoftwaredev commented Nov 9, 2023

What happened?

Fresh install of a project using django cookiecutter (using VS Code and Docker) results in new bash terminals not being configured correctly.

What should've happened instead?

The entrypoint should be executed and a bash terminal that can properly execute manage.py commands should be created.

Additional details

Project generation options:
The only ones that seem to matter are:
windows: Y
editor: VS Code
use_docker: Y

Simply opening a new bash terminal results in the following output:

bash: $'\r': command not found
bash: $'\r': command not found
bash: $'\r': command not found
: No such file or directory
bash: $'\r': command not found
: invalid option name
: invalid option name
: invalid option name
bash: $'\r': command not found
Agent pid 411
bash: $'\r': command not found
bash: $'\r': command not found
dev-user@e1580576785b:/app$ 

In previous versions of the cookiecutter template that did not try to integrate VS Code, I had my own solution to creating valid bash terminals (simply passing in a start script to the bash command line, which called entrypoint and executed the bash shell)

  • Host system configuration:
    • Version of cookiecutter CLI (get it with cookiecutter --version):
      Cookiecutter 2.4.0

    • OS name and version:
      OS Name: Microsoft Windows 11 Pro
      OS Version: 10.0.22621 N/A Build 22621

    • Python version, run python3 -V:
      3.11.6

    • Docker version (if using Docker), run docker --version:
      Docker version 24.0.6, build ed223bc

    • docker compose version (if using Docker), run docker compose --version:
      Docker Compose version v2.23.0-desktop.1

@browniebroke
Copy link
Member

Any idea what might cause this and how to fix it @masavini ?

@alhuede-thncs
Copy link

alhuede-thncs commented Feb 5, 2024

The issue seems to be if the bashrc.override.sh has CRLF line endings when the container is built.
If you change the line endings to LF, rebuild the container, the bashrc.override.sh script runs correctly.

@browniebroke
Copy link
Member

Thanks for the investigation, PR welcome

@alhuede-thncs
Copy link

Thanks for the investigation, PR welcome

I don't have the time to look into how to enforce LF line endings while generating the shell script. At the very least this thread can indicate to others what must be done if they have the same issue.

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

No branches or pull requests

3 participants