working file-watch on windows
This commit is contained in:
@@ -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 {}
|
||||
|
@@ -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)))))
|
Reference in New Issue
Block a user