{"id":22434473,"url":"https://github.com/notyusheng/eol-converter","last_synced_at":"2026-05-06T07:34:17.176Z","repository":{"id":261921388,"uuid":"885727935","full_name":"NotYuSheng/eol-converter","owner":"NotYuSheng","description":"A simple Python utility for converting end-of-line (EOL) characters in files to match the operating system format. Ideal for making .sh scripts created on Windows compatible with Unix/Linux environments to avoid execution errors.","archived":false,"fork":false,"pushed_at":"2024-11-09T08:34:05.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T13:14:36.187Z","etag":null,"topics":["docker","eol","line-endings"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotYuSheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-09T08:27:37.000Z","updated_at":"2024-11-09T08:35:46.000Z","dependencies_parsed_at":"2024-11-09T09:27:58.587Z","dependency_job_id":"363e7eaf-035e-4ebc-aac9-25f78af4835b","html_url":"https://github.com/NotYuSheng/eol-converter","commit_stats":null,"previous_names":["notyusheng/eol-converter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Feol-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Feol-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Feol-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2Feol-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotYuSheng","download_url":"https://codeload.github.com/NotYuSheng/eol-converter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806456,"owners_count":20675298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","eol","line-endings"],"created_at":"2024-12-05T23:08:19.934Z","updated_at":"2026-05-06T07:34:17.130Z","avatar_url":"https://github.com/NotYuSheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EOL Converter\n\nA simple Python utility for converting end-of-line (EOL) characters in files to the appropriate format for your operating system. This is especially useful when working with `.sh` scripts or other files created on Windows that need to be compatible with Unix/Linux systems.\n\n## Why Use EOL Converter?\n\nWhen `.sh` files are created on Windows, they typically use `\\r\\n` line endings. If transferred directly to a Unix/Linux environment, these scripts may encounter errors because Unix-based systems expect `\\n` line endings. This tool automates the process of converting EOL characters, ensuring compatibility across operating systems.\n\n## Common Error: Container Command Not Found\n\nIf you see an error like:\n\n```plaintext\ndocker: Error response from daemon: Container command '/start.sh' not found or does not exist.\n```\nThis may indicate that the .sh script has incorrect EOL characters for the environment. Windows-style line endings (\\r\\n) can make the script unreadable in Unix/Linux-based containers, causing this error. Running this EOL Converter on the script before using it in Docker should resolve the issue.\n\n## Features\n\n- Detects the current operating system and automatically applies the correct EOL character.\n- Ensures scripts and files are compatible across Windows, Unix, Linux, and MacOS.\n- Simple and easy-to-use interface.\n\n## Requirements\n\n- Python 3.x\n\n## Usage\n\n1. **Clone the repository**:\n    ```bash\n    git clone https://github.com/NotYuSheng/eol-converter.git\n    cd eol-converter\n    ```\n\n2. **Run the Script**:\n    Run the Python script, and it will prompt you to enter the path of the `.sh` file or any other text file that requires EOL conversion.\n    ```bash\n    python convert_eol.py\n    ```\n    After running, enter the path to your file:\n    ```plaintext\n    Enter the path to the .sh file to convert EOL characters: /path/to/your-script.sh\n    ```\n\n3. **File Conversion**:\n    The script reads the file, replaces the existing EOL characters with the correct format for your OS, and writes it back. It will confirm completion with a message.\n\n## Example\n\nTo convert a file called `example-script.sh` located in the same directory:\n```plaintext\nEnter the path to the .sh file to convert EOL characters: example-script.sh\n```\nAfter running, you’ll see:\n```\nConverted EOL characters in example-script.sh to '\\n'\n```\n\n## Limitations\n\nThis script assumes standard operating system EOL characters:\n- Windows: `\\r\\n`\n- Unix/Linux/MacOS: `\\n`\n\nIf the script is run on unsupported operating systems, it will raise an `OSError`.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Feol-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotyusheng%2Feol-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Feol-converter/lists"}