handlers/copy.lua

changeset 7
038275cd92ed
parent 3
b2df1b3f2c83
child 26
77cd7b8fb6a6
equal deleted inserted replaced
6:219d7a7304f8 7:038275cd92ed
1 1
2 module("handlers.copy", package.seeall) 2 --@module handlers.copy
3 3
4 require("dependency") 4 local path=require("path")
5 require("log")
6 5
7 function phase1(file, env) 6 local handlers_copy={}
7
8 local dependency=require("dependency")
9 local log=require("log")
10
11 function handlers_copy.phase1(file, env)
8 end 12 end
9 13
10 function phase2(file, env) 14 function handlers_copy.phase2(file, env)
11 local src=path.join(env.paths.src, file) 15 local src=path.join(env.paths.src, file)
12 local dst=path.join(env.paths.dst, file) 16 local dst=path.join(env.paths.dst, file)
13 if dependency.simple_update_check(dst, {src}) then 17 if dependency.simple_update_check(dst, {src}) then
14 log.log("Copy "..file.."\n") 18 log.log("Copy "..file.."\n")
15 local f = io.openX(src, 'r') 19 local f = io.openX(src, 'r')
21 end 25 end
22 dstf:write(data) 26 dstf:write(data)
23 end 27 end
24 end 28 end
25 end 29 end
30
31 return handlers_copy

mercurial