Method: Bundler::FileUtils.chmod_R

Defined in:
lib/bundler/vendor/fileutils/lib/fileutils.rb

.chmod_R(mode, list, noop: nil, verbose: nil, force: nil) ⇒ Object

Like Bundler::FileUtils.chmod, but changes permissions recursively.



1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
# File 'lib/bundler/vendor/fileutils/lib/fileutils.rb', line 1813

def chmod_R(mode, list, noop: nil, verbose: nil, force: nil)
  list = fu_list(list)
  fu_output_message sprintf('chmod -R%s %s %s',
                            (force ? 'f' : ''),
                            mode_to_s(mode), list.join(' ')) if verbose
  return if noop
  list.each do |root|
    Entry_.new(root).traverse do |ent|
      begin
        ent.chmod(fu_mode(mode, ent.path))
      rescue
        raise unless force
      end
    end
  end
end