File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 33-- Author: Marcos Kirsch
44
55local compileAndRemoveIfNeeded = function (f )
6- if file .open (f ) then
7- file .close ()
6+ if file .exists (f ) then
87 print (' Compiling:' , f )
98 node .compile (f )
109 file .remove (f )
Original file line number Diff line number Diff line change @@ -61,19 +61,19 @@ return function (port)
6161 uri .args = {code = 400 , errorString = " Bad Request" , logFunction = log }
6262 fileServeFunction = dofile (" httpserver-error.lc" )
6363 else
64- local fileExists = file .open (uri .file , " r" )
65- file .close ()
64+ local fileExists = false
6665
67- if not fileExists then
66+ if not file .exists (uri .file ) then
67+ -- print(uri.file .. " not found, checking gz version...")
6868 -- gzip check
69- fileExists = file .open (uri .file .. " .gz" , " r" )
70- file .close ()
71-
72- if fileExists then
73- -- print("gzip variant exists, serving that one")
69+ if file .exists (uri .file .. " .gz" ) then
70+ -- print("gzip variant exists, serving that one")
7471 uri .file = uri .file .. " .gz"
7572 uri .isGzipped = true
73+ fileExists = true
7674 end
75+ else
76+ fileExists = true
7777 end
7878
7979 if not fileExists then
You can’t perform that action at this time.
0 commit comments