changing ref to commit

This commit is contained in:
Abir Majumdar 2018-08-23 22:55:46 -07:00 committed by GitHub
parent f747f5c903
commit 1f94b2e1fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ def update_puppetfile_module_ref(puppetfile_repo, module_info)
begin begin
contents = File.read("#{puppetfile_repo.git_work_dir}/Puppetfile") contents = File.read("#{puppetfile_repo.git_work_dir}/Puppetfile")
puts "original file contents = #{contents}" puts "original file contents = #{contents}"
regex = /mod (["'])#{module_info.module_name}\1(.*?)[\n]\s*:ref\s*=>\s*(['"])(\w+|\w+\.\d+\.\d+)\3/m regex = /mod (["'])#{module_info.module_name}\1(.*?)[\n]\s*:commit\s*=>\s*(['"])(\w+|\w+\.\d+\.\d+)\3/m
new_contents = contents.gsub(regex, """ new_contents = contents.gsub(regex, """
mod '#{module_info.module_name}'\\2 mod '#{module_info.module_name}'\\2