diff --git a/bin/outdated_modules_and_their_version b/bin/outdated_modules_and_their_version index 55b6ecd1..672d9051 100755 --- a/bin/outdated_modules_and_their_version +++ b/bin/outdated_modules_and_their_version @@ -11,10 +11,18 @@ mod_ary = [] width_modules = 6 # min width is width of String "modulesync_config version" width_version = 25 -Dir.glob('modules/voxpupuli/puppet-*/.msync.yml').each do|f| - version_module = YAML.load_file(f)['modulesync_config_version'] - mod = f.split('/')[2] - if version != version_module +Dir.glob('modules/voxpupuli/puppet-*').sort.each do |f| + if File.exists?(f + '/.msync.yml') + version_module = YAML.load_file(f + '/.msync.yml')['modulesync_config_version'] + mod = (f).split('/')[2] + if version != version_module + mod_ary.push([mod, version_module]) + width_modules = [width_modules, mod.length].max + width_version = [width_version, version_module.length].max + end + else + version_module = 'None' + mod = (f).split('/')[2] mod_ary.push([mod, version_module]) width_modules = [width_modules, mod.length].max width_version = [width_version, version_module.length].max