Skip to content

config_version scripts: commit-ID length mismatch, ruby() fallback flaw, ShellCheck warnings #12

Description

@miharp

Small cleanups in scripts/:

  1. Comment/behavior mismatchconfig_version-r10k.rb says "first 12 characters of the commit ID" but [0...11] returns 11 (verified output: host-production-abcdef12345). Use [0...12] or fix the comment.
  2. Fallback can run a second interpreter — the ruby() helper in config_version.sh:
    [ -x /opt/puppetlabs/puppet/bin/ruby ] \
      && /opt/puppetlabs/puppet/bin/ruby "$@" \
      || /usr/bin/env ruby "$@"
    If the preferred Ruby exists but exits non-zero, the || branch runs env ruby on the same args too. Use an if/else.
  3. ShellCheck warnings — obsolete -o compound test in the usage check, and unquoted $1/$2 path expansions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions