Method: OpenC3::TargetModel.modified_files
- Defined in:
- lib/openc3/models/target_model.rb
.modified_files(name, scope:) ⇒ Object
Given target’s modified file list
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/openc3/models/target_model.rb', line 120 def self.modified_files(name, scope:) modified = [] rubys3_client = Aws::S3::Client.new token = nil while true resp = rubys3_client.list_objects_v2({ bucket: 'config', max_keys: 1000, # The trailing slash is important! prefix: "#{scope}/targets_modified/#{name}/", continuation_token: token }) resp.contents.each do |item| # Results look like DEFAULT/targets_modified/INST/procedures/new.rb # so split on '/' and ignore the first two values modified << item.key.split('/')[2..-1].join('/') end break unless resp.is_truncated token = resp.next_continuation_token end # Sort to enable a consistent listing of the modified files modified.sort end |