-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRun.hx
More file actions
34 lines (29 loc) · 689 Bytes
/
Copy pathRun.hx
File metadata and controls
34 lines (29 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import sys.FileSystem;
import haxe.io.Path;
function recursiveDelete(path:String) {
if (!FileSystem.exists(path)) {
return;
} else if (FileSystem.isDirectory(path)) {
for (child in FileSystem.readDirectory(path)) {
recursiveDelete(Path.join([path, child]));
}
FileSystem.deleteDirectory(path);
} else {
FileSystem.deleteFile(path);
}
}
function main() {
final args = Sys.args();
if (Sys.getEnv("HAXELIB_RUN") != null) {
args.pop();
}
switch args[0] {
case "rebuild":
Sys.command("haxe", ["extract.hxml"]);
case "clean":
recursiveDelete("hxclasses");
recursiveDelete("generated");
case null | "--help":
Sys.println("air [rebuild|clean]");
}
}