working file-watch on windows

This commit is contained in:
2020-11-19 16:16:36 -07:00
parent 8588bfc8b7
commit 2832cc55fc
6 changed files with 33 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
package;
import sys.io.File;
import sys.io.Process;
import kiss.Kiss;
import kiss.Prelude;
@:build(kiss.Kiss.build("src/Main.kiss"))
class Main {}

View File

@@ -1,2 +1,19 @@
(defun check [file delay command erase]
(let [contents
(try
(File.getContent file)
(catch [e] ""))]
(if (< 0 contents.length)
#|for (line in contents.split("\n")) {
new Process(StringTools.replace(command, "{}", '"' + line + '"'));
}|#))
(if erase (File.saveContent file ""))
(Sys.sleep delay)
(check file delay command erase))
(defun main []
(trace (nth (Sys.args) 0)))
(check
(nth (Sys.args) 0)
(Std.parseFloat (nth (Sys.args) 1))
(nth (Sys.args) 2)
(= 1 (Std.parseInt (nth (Sys.args) 3)))))