Permalink
Browse files

Fix build error when trace mode

Rakefile

```
file "a.txt" do
  system "echo hello > a.txt"
end

file "b.txt" => "a.txt" do
  system "cp a.txt b.txt"
end

task :default => "b.txt"
```

```
$ touch b.txt
$ ruby minirake --trace
Invoke default (already=[], needed=[true])
rake aborted!
No such file or directory @ rb_file_s_stat - a.txt
minirake:241:in `stat'
minirake:241:in `timestamp'
minirake:233:in `block in needed?'
minirake:233:in `collect'
minirake:233:in `needed?'
minirake:91:in `invoke'
minirake:95:in `block in invoke'
minirake:95:in `each'
minirake:95:in `invoke'
minirake:467:in `block in run'
minirake:466:in `each'
minirake:466:in `run'
minirake:484:in `<main>'
```
  • Loading branch information...
ksss committed Feb 10, 2017
1 parent f2b18a6 commit cd8284fe0b156aaa6e4cb3f9cb934da25d4829be
Showing with 1 addition and 0 deletions.
  1. +1 −0 minirake
View
@@ -237,6 +237,7 @@ module MiniRake
# Time stamp for file task.
def timestamp
return Time.at(0) unless File.exist?(name)
stat = File::stat(name.to_s)
stat.directory? ? Time.at(0) : stat.mtime
end

0 comments on commit cd8284f

Please sign in to comment.