bundler/lib/dependabot/bundler/file_updater.rb
# Returns changed files in the vendor/cache folder
#
# @param base_directory [String] Update config base directory
# @return [Array<Dependabot::DependencyFile>]
Returns changed files in the vendor/cache folder
Returns changed files in the vendor / cache folder
def updated_vendor_cache_files(base_directory:)
        return [] unless repo_contents_path && vendor_cache_dir
        Dir.chdir(repo_contents_path) do
          relative_dir = vendor_cache_dir.sub("#{repo_contents_path}/", "")
          status = SharedHelpers.run_shell_command(
            "git status --untracked-files=all --porcelain=v1 #{relative_dir}"
          )
          changed_paths = status.split("\n").map { |l| l.split(" ") }
          changed_paths.map do |type, path|
            deleted = type == "D"
            encoding = Dependabot::DependencyFile::ContentEncoding::BASE64
            encoded_content = Base64.encode64(File.read(path)) unless deleted
            Dependabot::DependencyFile.new(
              name: path,
              content: encoded_content,
              directory: base_directory,
              deleted: deleted,
              content_encoding: encoding
            )
          end
        end
      end
def updated_vendor_cache_files ( base_directory : ) return [ ] unless repo_contents_path && vendor_cache_dir Dir . chdir ( repo_contents_path ) do relative_dir = vendor_cache_dir . sub ( "#{repo_contents_path}/" , "" ) status = SharedHelpers . run_shell_command ( "git status --untracked-files=all --porcelain=v1 #{relative_dir}" ) changed_paths = status . split ( "\n" ) . map { | l | l . split ( " " ) } changed_paths . map do | type , path | deleted = type == "D" encoding = Dependabot :: DependencyFile :: ContentEncoding :: BASE64 encoded_content = Base64 . encode64 ( File . read ( path ) ) unless deleted Dependabot :: DependencyFile . new ( name : path , content : encoded_content , directory : base_directory , deleted : deleted , content_encoding : encoding ) end end end
Returns changed files in the vendor/cache folder
Returns changed files in the vendor / cache folder
None
Array<Dependabot::DependencyFile>
base_directory
Update config base directory
Update config base directory