31 end |
31 end |
32 |
32 |
33 open(target, File::RDONLY|File::CREAT, 0644) do |f| |
33 open(target, File::RDONLY|File::CREAT, 0644) do |f| |
34 if running_hook |
34 if running_hook |
35 exit unless f.flock(File::LOCK_EX|File::LOCK_NB) |
35 exit unless f.flock(File::LOCK_EX|File::LOCK_NB) |
36 exit unless (Time.now - f.mtime) > 60 |
36 exit unless f.size == 0 || (Time.now - f.mtime) > 60 |
37 end |
37 end |
38 |
38 |
39 system(<<-CMD) or exit $?.exitstatus |
39 system(<<-CMD) or exit $?.exitstatus |
40 #{list_cmd} \ |
40 #{list_cmd} \ |
41 | #{ctags_cmd} --tag-relative -L - -f"#{tmp}" #{opts} \ |
41 | #{ctags_cmd} --tag-relative -L - -f"#{tmp}" #{opts} \ |