premake/util/sdl_gen_config.lua
changeset 10422 34fb2e531f7c
parent 9998 f67cf37e9cd4
equal deleted inserted replaced
10421:55fd4e519a58 10422:34fb2e531f7c
    31 local insertLocation
    31 local insertLocation
    32 
    32 
    33 -- This function begins config header generation given the name of the generated
    33 -- This function begins config header generation given the name of the generated
    34 -- file and the name of the template file to use.
    34 -- file and the name of the template file to use.
    35 function startGeneration(file, template)
    35 function startGeneration(file, template)
    36 	configFile = fileopen(file, "wt")
    36 	configFile = fileopen(file, "w")
    37 	templateFileContents = readfile(template, "rt")
    37 	templateFileContents = readfile(template, "r")
    38 	insertLocation = templateFileContents:find(searchKey)
    38 	insertLocation = templateFileContents:find(searchKey)
    39 	if insertLocation then
    39 	if insertLocation then
    40 		configFile:write(templateFileContents:sub(1, insertLocation - 1))
    40 		configFile:write(templateFileContents:sub(1, insertLocation - 1))
    41 	end
    41 	end
    42 end
    42 end