npryce / adr-tools

Command-line tools for working with Architecture Decision Records
Other
4.53k stars 578 forks source link

Resolving Shellcheck SD2086 and SC2046 #104

Open JonTheNiceGuy opened 3 years ago

JonTheNiceGuy commented 3 years ago

Shellcheck results SC2046 and SC2086 relate to how variables are handled where they may hold strings with spaces or "glob"ing characters (like * and ?).

In this PR, I wrap all script or function calls which pass variables that are themselves variables ($foo), or commands ($(foo)).

Note that this broke the test for generate-contents-with-prefix, so I resolved that by changing getopt $* to getopts in src/_adr_generate_toc.

This also removes the unnecesary loading of the config file in _adr_dir.