1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/fileutils.rb (touch): last #touch change causes error when :mtime option was not given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2007-03-03 13:54:54 +00:00
parent e089d1161d
commit 738bf0e8a4
2 changed files with 7 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Sat Mar 3 22:54:33 2007 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (touch): last #touch change causes error when
:mtime option was not given.
Sat Mar 3 22:51:29 2007 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (mv): could not move directory between

View file

@ -1012,13 +1012,9 @@ module FileUtils
fu_check_options options, OPT_TABLE['touch']
list = fu_list(list)
created = nocreate = options[:nocreate]
t = options[:mtime]
t = options[:mtime] || Time.now
if options[:verbose]
fu_output_message "touch #{
nocreate ? ' -c' : ''
}#{
t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''
}#{list.join ' '}"
fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
end
return if options[:noop]
list.each do |path|