Method: Thor::Actions#chmod
- Defined in:
- lib/wtch/vendor/thor/actions/file_manipulation.rb
#chmod(path, mode, config = {}) ⇒ Object
Changes the mode of the given file or directory.
Parameters
- mode<Integer>
-
the file mode
- path<String>
-
the name of the file to change mode
- config<Hash>
-
give :verbose => false to not log the status.
Example
chmod "script/*", 0755
106 107 108 109 110 111 |
# File 'lib/wtch/vendor/thor/actions/file_manipulation.rb', line 106 def chmod(path, mode, config={}) return unless behavior == :invoke path = File.(path, destination_root) say_status :chmod, relative_to_original_destination_root(path), config.fetch(:verbose, true) FileUtils.chmod_R(mode, path) unless [:pretend] end |