class FPM::Fry::Plugin::EditStaging::AddFile

@api private

Public Instance Methods

call(_ , package) click to toggle source
# File lib/fpm/fry/plugin/edit_staging.rb, line 13
def call(_ , package)
  file = package.staging_path(path)
  package.logger.debug("Writing file directly to staging", target: file, content: io.inspect)
  FileUtils.mkdir_p(File.dirname(file))
  File.open(file,'w') do | f |
    IO.copy_stream(io, f)
    if options[:chmod]
      f.chmod(options[:chmod])
    end
  end
  io.close if io.respond_to? :close
end