Skip to content

Commit

Permalink
[scripts][dependency] Add case for when we update via repository.lic
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR committed Dec 12, 2024
1 parent 9739099 commit ffd3020
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dependency.lic
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require 'ostruct'
require 'digest/sha1'
require 'monitor'

$DEPENDENCY_VERSION = '2.0.4'
$DEPENDENCY_VERSION = '2.0.5'
$MIN_RUBY_VERSION = '3.2.2'
DRINFOMON_IN_CORE_LICH ||= false
DRINFOMON_CORE_LICH_DEFINES ||= Array.new
Expand Down Expand Up @@ -387,6 +387,13 @@ class ScriptManager
return unless info
return if get_versions[filename] == info['sha'] && !force

if filename == 'dependency.lic' && File.exist?(File.join(SCRIPT_DIR, filename))
body = File.open(File.join(SCRIPT_DIR, filename), 'r').readlines.join('')
@versions[filename] = Digest::SHA1.hexdigest('blob' + " #{body.size}" + "\0" + body)

return if info['sha'] == @versions[filename]
end

echo("info:#{info}") if @debug
blob = make_request(info['url'])
File.open(File.join(SCRIPT_DIR, "#{filename}"), 'w') { |file| file.print(Base64.decode64(blob['content'])) }
Expand Down

0 comments on commit ffd3020

Please sign in to comment.