aboutsummaryrefslogtreecommitdiffstats
path: root/lib/un.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/un.rb')
-rw-r--r--lib/un.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/un.rb b/lib/un.rb
index 745afcd958..b644fd9be4 100644
--- a/lib/un.rb
+++ b/lib/un.rb
@@ -196,7 +196,7 @@ end
def install
setup("pm:o:g:") do |argv, options|
- (mode = options.delete :m) and options[:mode] = mode
+ (mode = options.delete :m) and options[:mode] = /\A\d/ =~ mode ? mode.oct : mode
options[:preserve] = true if options.delete :p
(owner = options.delete :o) and options[:owner] = owner
(group = options.delete :g) and options[:group] = group
@@ -216,7 +216,8 @@ end
def chmod
setup do |argv, options|
- mode = argv.shift.oct
+ mode = argv.shift
+ mode = /\A\d/ =~ mode ? mode.oct : mode
FileUtils.chmod mode, argv, options
end
end