weaveworks / wks-quickstart-firekube

Example configuration to create Kubernetes clusters powered by ignite and gitops
342 stars 372 forks source link

shellcheck: fix errors, unwrap the version_lt logic #68

Closed mflendrich closed 5 years ago

mflendrich commented 5 years ago

Part of #66.

Fixes most of the shellcheck complaints. Suppresses two - where the suggestion seems impractical (because bash variable expansion would look ugly with many slashes escaped)

One of the warnings referred to the complex logical expression in version_lt. Rewrote the expression for easier comprehension (hopefully).

After this PR:

$ shellcheck **.sh

In lib/functions.sh line 159:
    if ! command_exists "${cmd}" || [ "${download_force}" == "yes" ]; then
                                       ^---------------^ SC2154: download_force is referenced but not assigned.

In lib/functions.sh line 160:
        if [ "${download}" == "yes" ]; then
              ^---------^ SC2154: download is referenced but not assigned.

For more information:
  https://www.shellcheck.net/wiki/SC2154 -- download is referenced but not as...