We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module FilePatch def file(target, options={}) options[:source] ||= begin source_file = Tempfile.new('generate') yield(source_file) if block_given? source_file.close source_file.path end source = options[:source] target = path(target) copy_file = true msg = case when !File.exists?(target) :create when FileUtils.cmp(source, target) :exists when force_file_collision?(target) :force else copy_file = false :skip end log_relative msg, target if copy_file && !pretend dir = File.dirname(target) FileUtils.mkdir_p(dir, :mode => 0755) unless File.exists?(dir) FileUtils.mv(source, target, :force => true) FileUtils.chmod(0644, target) end target end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: