php-malware-finder
php-malware-finder copied to clipboard
Clean up our main script
Currently, our main script's code looks quite ugly. It would be nice if someone with some shell-fu could take a look at it, and clean it up.
Maybe rewrite the whole thing in Go? ;) (got a working rewrite in Go, we really should test it someday!)
Do you think a script based on the Bash3 boilerplate and trying to show little to no errors from ShellCheck would be a good idea ?
I'm worried the MIT licence from the Bash3 boilerplate can be an issue...
I'm not a big fan of bringing in a whole external dependency for our simple'n'stupid bash script tbh :/
But the shellcheck idea is great, I think that we ran it on the codebase at some point.
I don't see it as importing a whole external dependency, but rather using some ideas (see the Scoping, Coding style and Safety and Portability parts on b3bp website) or some parts of it. For instance, I started to :
- switch to local variables ;
- switch to stricts options for bash ;
- use brace expansions.
Be my guest if you want to improve the script, I'll be happy to review your PR :)