Open mattwynne opened 2 years ago
We could have a main.sh
that looks like:
# declare global vars
source util.sh
source self-update.sh
source javascript.sh
source java.sh
...
# read program arguments
# run program
This would put the argument parsing and execution front and center and would give people some help understanding everything else.
Installing could be done by downloading a zip/tar from GitHub. And that would be easier after #67 is done because then we have the hooks to make releases.
It would break the updater but that's what major versions are for. This project is used by like 5 people. So nog big deal if we don't do it often.
That said, with only ~550 lines and unlikely to grow much bigger I don't think we'll gain much from splitting files.
Rather I think improving the structure in the file could remove the worst of the intimidation factor.
If we put the main block in a function on top and then invoke main at the bottom of the file. It would show people the meat of the program straight away while deferring everything else til later.
🤔 What's the problem you've observed?
When I've talked to other people about this script, I've heard feedback that it's intimidating.
✨ Do you have a proposal for making it better?
I'm thinking that the code would be easier to read if it was broken over multiple files. This could enable us to make the language "plugins" each live in separate files.
📚 Any additional context?
A consequence of this would be that we'd have to change how the tool is deployed (since it currently assumes it's a single file).
This text was originally generated from a template, then edited by hand. You can modify the template here.