File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,9 @@ function get_sleep_func()
241241 end ) then
242242 sleep = moonscript ._sleep
243243 end
244+ if not sleep then
245+ error (" Missing sleep function; install LuaSocket" )
246+ end
244247 return sleep
245248end
246249
@@ -254,12 +257,13 @@ end
254257
255258-- returns an iterator that returns files that have been updated
256259function create_watcher (files )
257- local msg = " Starting watch loop, Ctrl-C to exit"
260+ local msg = " Starting watch loop ( Ctrl-C to exit) "
258261
259262 local inotify
260263 pcall (function ()
261264 inotify = require " inotify"
262265 end )
266+ inotify = nil
263267
264268 if inotify then
265269 local dirs = {}
@@ -324,7 +328,11 @@ if opts.w then
324328 -- catches interrupt error for ctl-c
325329 local protected = function ()
326330 local status , file = pcall (watcher )
327- if status then return file end
331+ if status then
332+ return file
333+ elseif file ~= " interrupted!" then
334+ error (file )
335+ end
328336 end
329337
330338 for fname in protected do
You can’t perform that action at this time.
0 commit comments