Class: Dependabot::Nix::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/nix/file_updater.rb

Instance Method Summary collapse

Instance Method Details

#updated_dependency_filesObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/dependabot/nix/file_updater.rb', line 18

def updated_dependency_files
  updated_files = []

  updated_flake_nix_content = update_flake_nix
  updated_files << updated_file(file: flake_nix, content: updated_flake_nix_content) if updated_flake_nix_content

  updated_lockfile_content = update_flake_lock(updated_flake_nix_content)

  if updated_lockfile_content == flake_lock.content
    raise Dependabot::DependencyFileContentNotChanged,
          "Expected flake.lock to change for #{dependency.name}, but it didn't"
  end

  updated_files << updated_file(file: flake_lock, content: updated_lockfile_content)
  updated_files
end