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

2 shellcheck fails (SC1117). #70

Closed
chris001 opened this issue Jun 6, 2022 · 5 comments
Closed

2 shellcheck fails (SC1117). #70

chris001 opened this issue Jun 6, 2022 · 5 comments

Comments

@chris001
Copy link
Contributor

chris001 commented Jun 6, 2022

In virtualmin-install.sh line 808:
      rpm_release_files=$(echo "$rpm_release_files" | tr "\n" " ")
                                                          ^-- SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".


In virtualmin-install.sh line 822:
      sed -i "s/http:\/\//https:\/\//" /etc/yum.repos.d/virtualmin.repo
                     ^-- SC1117: Backslash is literal in "\/". Prefer explicit escaping: "\\/".
                       ^-- SC1117: Backslash is literal in "\/". Prefer explicit escaping: "\\/".
                                ^-- SC1117: Backslash is literal in "\/". Prefer explicit escaping: "\\/".
                                  ^-- SC1117: Backslash is literal in "\/". Prefer explicit escaping: "\\/".

Note: shellcheck command was run on Debian 10.

@swelljoe
Copy link
Collaborator

swelljoe commented Jun 6, 2022

This sed would probably be better off as something like sed -i "s#http:#https:#" anyway. Just a lot more readable than all those slashes. And, bypasses all the escaping bullshit.

I don't know about the tr. Might be better to temporarily set IFS to \n and loop over it directly, but maybe shellcheck would complain about that, too.

@swelljoe
Copy link
Collaborator

swelljoe commented Jun 6, 2022

Odd that shellcheck on travis is not complaining.

@chris001
Copy link
Contributor Author

chris001 commented Jun 6, 2022

Is possibly because different OS and version running in Travis vs Debian 10.

@iliajie
Copy link
Contributor

iliajie commented Jun 6, 2022

@chris001 Check the last commit. I expect it will fix your issue.

@chris001
Copy link
Contributor Author

chris001 commented Jun 6, 2022

@iliajie That works! One step closer to automatically test each PR and official Release by having Travis install on all supported OS! #61 #35

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

3 participants