mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 16:33:57 +08:00
19 lines
348 B
Ruby
19 lines
348 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require "fileutils"
|
||
|
|
||
|
# See: https://github.com/docker/for-linux/issues/1015
|
||
|
|
||
|
module FileUtils
|
||
|
class Entry_
|
||
|
def copy_file(dest)
|
||
|
File.open(path()) do |s|
|
||
|
File.open(dest, "wb", s.stat.mode) do |f|
|
||
|
IO.copy_stream(s, f)
|
||
|
f.chmod(f.lstat.mode)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|