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

Linux cannot start the setup script file #68

Open
136750162 opened this issue Feb 2, 2023 · 5 comments
Open

Linux cannot start the setup script file #68

136750162 opened this issue Feb 2, 2023 · 5 comments

Comments

@136750162
Copy link

136750162 commented Feb 2, 2023

[root@einwin3-api02 wrends]# ./setup --cli
-bash: ./setup: /bin/sh^M: bad interpreter: No such file or directory

@pavelhoral
Copy link
Member

Is it possible you have changed line endings in that file by mistake? I have just checked what is included in our build and it has correct line endings in there.

@136750162
Copy link
Author

Is it possible you have changed line endings in that file by mistake? I have just checked what is included in our build and it has correct line endings in there.

I use IDEA maven to build in windos, and then upload the built zip package to the Linux server, and then execute the setup file, and the error just appeared. Whether it is a windos build, the configuration of the packaging-related plug-ins needs to be changed to be normal What about running on Linux?

@pavelhoral
Copy link
Member

Ok, we might want to add .gitattributes to make sure shell scripts always have LF line endings. I guess cloning repository on Windows will checkout text files with CRLF line endings.

@136750162
Copy link
Author

Ok, we might want to add .gitattributes to make sure shell scripts always have LF line endings. I guess cloning repository on Windows will checkout text files with CRLF line endings.

How do I need to set up so that the format of the packaged .sh file can be converted from dos to unix format?

@pavelhoral
Copy link
Member

You can quickly fix your issues with dos2unix *.sh on your Linux machine forcing correct line endings; or disable core.autocrlf in git config on your Windows machine (and make a fresh clone).


I was checking how Tomcat handles line endings and they are forcing them in their Ant build script. Quite interesting that they went this way instead of using .gitattributes. I don't want to do in Wren something that is not a common practice so I have to check few other OSS projects for inspiration.

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

No branches or pull requests

2 participants