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

Script editor: align line endings when saving a script to server #592

Open
bugy opened this issue Oct 26, 2022 · 3 comments
Open

Script editor: align line endings when saving a script to server #592

bugy opened this issue Oct 26, 2022 · 3 comments

Comments

@bugy
Copy link
Owner

bugy commented Oct 26, 2022

Reported by @IVIJL

Also edit of .sh script through script-server has bug, when I saved it it was complaining that script is missing, but script was there updated from your server(did saved the changes) on same path with same rights but for server it was for some reason unreadable and server didnt see it even with same owner and rights as before. Must be some utf/EOL issue because only thing that helped is that I moved script away and created new file and just CTRL-V through nano there and server started to see it again.

when just editing and saving all went fine
but when CTRL-A copy to vscode in which I have LF line ending by default, then modify the script CTRL-A in vscode and put it back in server editor and hit save did make those CRLF endings
strange is that my vscode has LF ending by default so CRLF endings must have there been added through windows clipboard somehow
so just quick fix will be always apply LF line endings on save in server
as LF endings are not an issue in windows enviroments so will work fine everywhere but CRLF is problem in all linux enviroments.
also tested when I run simple sed -i 's/\r//' parameterized.sh it will fix line endings and runs again without problems.

@bugy bugy added the bug label Oct 26, 2022
@bugy bugy added the resolved label Nov 6, 2022
@bugy bugy added this to the 1.18.0 milestone Nov 6, 2022
@bugy
Copy link
Owner Author

bugy commented Nov 6, 2022

Hi @IVIJL, unfortunately, I wasn't able to reproduce the problem. Scripts are opening fine from my linux even with \r\n line endings.
But I still made a fix, that line endings are normalized according to an operating system on a server.

If you could test it on dev build, that would be great

@IVIJL
Copy link

IVIJL commented Nov 27, 2022

Hello @bugy didn't notice you had an update for me until now, I did test it today on version 1.18.0, and looks like it's working on windows now, wasn't able to reproduce it either anymore. The script is visible to the server after my modification through vscode and clipboard manipulation. So from windows side it all looks good!

@bugy
Copy link
Owner Author

bugy commented Nov 27, 2022

Cool, thanks!

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

No branches or pull requests

2 participants