Skip to content

v2.0.4

Latest
Compare
Choose a tag to compare
@zpiatt zpiatt released this 11 Aug 20:24
· 11 commits to main since this release

Version 2 is here! Gen has come a long way from a simple function in my bashrc. I've probably learned more Bash than anyone needs to know in making this, and it's been a lot of fun. Thank you to everyone who helped get me this far!

This release contains a major functionality change, and several small bug fixes:

Bug Fixes/Improvements:

  1. Realigned templates with original design intent. Only shell script support is hard-coded into gen.
    • Custom templates continue to be 100% optional, however, gen installs several examples by default.
    • My goal is to make the main script as simple as possible with the intent for streamlined scripting; not a replacement for robust boilerplate solutions.
  2. Complete overhaul of error codes and exit statuses.
    • Gen will now exit on errors with statuses that reflect the nature of the error. Please check out the man page for more details.
  3. Man page is now complete.
    • The man includes details on exit statuses, a thorough explanation on how gen selects an editor, the thought process for changing file permissions, and descriptions for all arguments.
  4. Removed all HereDocs.
    • This is purely a style choice, however, HereDocs require actual tab characters to maintain readability. In practice, HereDocs (IMHO) become unreadable easily, so I did away with them entirely.
    • I made several other small changes in the name of readability.
  5. Complete rework of the create_file function to handle all error cases ( hopefully ).
  6. Complete rework of file permission assignments.
    • gen now automatically ensures at least read/write permissions are given to the user. In practice, this should catch any umask errors, or read-only filesystems.
    • Gen relies on the robust error handling of chmod and allows error messages from chmod to be printed.
  7. Deprecated -x option. -c now handles all possible custom file permissions. ( Must use octal mode bits [ i.e. 754, etc. ] ).
    • I also added input validation to -c that confirm a user enter 3 digits from 0-7. I may revisit this and attempt to include symbolic mode bits ( u+rw ) as well.

Moving forward:

  1. I'm working on adding workflows for automated testing. I have almost no knowledge of how this works, so this is mostly for me to learn. My goal would be more reliable commits.
  2. No features will be pushed/pulled that cannot pass shellcheck AND set -o nounset.