More useless tweaks to fix Windows
This commit is contained in:
parent
5857d14824
commit
ea6b102678
2 changed files with 10 additions and 3 deletions
4
pool.lua
4
pool.lua
|
@ -5,7 +5,9 @@ local util = dofile(base.."/util.lua")
|
||||||
local serpent = dofile(base.."/serpent.lua")
|
local serpent = dofile(base.."/serpent.lua")
|
||||||
local libDeflate = dofile(base.."/LibDeflate.lua")
|
local libDeflate = dofile(base.."/LibDeflate.lua")
|
||||||
|
|
||||||
local hasThreads = not util.isWin and config.NeatConfig.Threads > 1
|
local hasThreads =
|
||||||
|
not util.isWin and
|
||||||
|
config.NeatConfig.Threads > 1
|
||||||
local Runner = nil
|
local Runner = nil
|
||||||
if hasThreads then
|
if hasThreads then
|
||||||
Runner = dofile(base.."/runner-wrapper.lua")
|
Runner = dofile(base.."/runner-wrapper.lua")
|
||||||
|
|
9
util.lua
9
util.lua
|
@ -99,8 +99,13 @@ function _M.waitForChange(filenames, count, wild)
|
||||||
local sec, usec = utime()
|
local sec, usec = utime()
|
||||||
print(string.format('Starting watching file at %d', sec * 1000000 + usec))
|
print(string.format('Starting watching file at %d', sec * 1000000 + usec))
|
||||||
|
|
||||||
return _M.popenCmd([[powershell "$filename = ']]..wild..
|
local poppet = _M.popenCmd([[powershell "$filename = ']]..wild..
|
||||||
[[' ; $targetCount = ]]..count..[[ ; $count = 0 ; Register-ObjectEvent (New-Object IO.FileSystemWatcher (Split-Path $filename), (Split-Path -Leaf $filename) -Property @{ IncludeSubdirectories = $false ; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}) -EventName Changed -SourceIdentifier RunnerDataChanged -Action { $count += 1 ; if ( $count -ge $targetCount ) { [Environment]::Exit(0) } } ; while($true) { Start-Sleep -Milliseconds 1 }"]])
|
[[' ; $targetCount = ]]..count..[[ ; $count = 0 ; $action = { $count += 1 ; if ( $count -ge $targetCount ) { [Environment]::Exit(0) } } ; (Register-ObjectEvent (New-Object IO.FileSystemWatcher (Split-Path $filename), (Split-Path -Leaf $filename) -Property @{ IncludeSubdirectories = $false ; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}) -EventName Changed -SourceIdentifier RunnerDataChanged -Action $action).Name ; while($true) { Start-Sleep -Seconds 5 }"]])
|
||||||
|
|
||||||
|
while poppet:read('*l'):sub(1, 17) ~= 'RunnerDataChanged' do
|
||||||
|
end
|
||||||
|
|
||||||
|
return poppet
|
||||||
else
|
else
|
||||||
local watchCmd = ''
|
local watchCmd = ''
|
||||||
if count == 1 then
|
if count == 1 then
|
||||||
|
|
Loading…
Add table
Reference in a new issue