Skip to content

Commit f9d2836

Browse files
committed
feat: option to disregard hash.json
1 parent 1e31175 commit f9d2836

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/anchor/type_script/multifile_save_service.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ def self.call(...)
88
new(...).call
99
end
1010

11-
def initialize(generator:, folder_path:, force: false)
11+
def initialize(generator:, folder_path:, force: false, trust_hash: true)
1212
@generator = generator
1313
@folder_path = folder_path
1414
@force = force
15+
@trust_hash = trust_hash
1516
end
1617

1718
def call
@@ -47,7 +48,7 @@ def save_result(result)
4748
return result.name
4849
end
4950

50-
return if sha_hash[result.name] == Digest::SHA256.hexdigest(result.text)
51+
return if @trust_hash && sha_hash[result.name] == Digest::SHA256.hexdigest(result.text)
5152

5253
existing_content = File.read(path)
5354

0 commit comments

Comments
 (0)