-
Notifications
You must be signed in to change notification settings - Fork 433
Update EmuHawkMono.sh #4594
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
base: master
Are you sure you want to change the base?
Update EmuHawkMono.sh #4594
Conversation
Added: * check against useless `"$0"`, * `export GTK_PREFIX=`, and * shellcheck directives against warnings; redirected status messages to `stderr`; and removed `exec`.
|
I complied with what seems to be the style guide, but that isn't the standard style guide (notably, the use of double-quotes instead of single-quotes and the quoted |
YoshiRulz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by this PR. Did you just throw it into a linter and apply every suggestion?
Assets/EmuHawkMono.sh
Outdated
| *"EmuHawkMono.sh");; | ||
| *"/bin/"*"sh") | ||
| # Very bad way to detect /path/to/shell | ||
| echo "I don't know where I am! Could you run me as \"/path/to/EmuHawkMono.sh\"?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should support being renamed via symlinking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this now support something like ln -s /opt/bizhawk/EmuHawkMono.sh ~/.local/bin/emuhawk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It will just think you're running it with a shell if that executable's name ends in sh, but not .sh, and it is in a folder called bin. I don't know how else to better detect a shell, since bash for some reason uses its fullly-qualified path as "$0" when a script is sourced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's what this is for. I'm not sure I want to merge a hack just to detect a niche user error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's fair. You could remove the hacky part, though you should probably keep the non-hacky part.
|
No, I didn't "just throw it into a linter", though I do have a linter in my IDE. I noticed some minor issues, and thought the simplest way to get them fixed was to simply open a PR. |
|
What's this style guide you're referring to? |
|
I guess there isn't a strict “standard style guide”, just “what you'll generally see code written like online/in books”, thus being what more people are used to. If you mean your style guide, it's what I inferred from how you wrote the code in that file. |
|
Why do we need to set |
Added:
"$0",export GTK_PREFIX=, andreplaced
printfwithecho; redirected status messages tostderr; added--safeguard for builtins when necessary; and removedexec.Check if completed: