Skip to content

Commit

Permalink
Show generator complete message only when complete
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk committed Jul 27, 2024
1 parent 1f8a3a2 commit 52a4ba6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class Main {
generators.RobotsTxt.generate();

// Patch as post process the html file with syntax highlighting
SyntaxHighlighter.patch();

var end = Date.now().getTime();
Sys.println('Generation complete, time ${(end - start)/1000}s');
SyntaxHighlighter.patch(function () {
var end = Date.now().getTime();
Sys.println('Generation complete, time ${(end - start) / 1000}s');
});
}

}
4 changes: 3 additions & 1 deletion src/SyntaxHighlighter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sys.io.File;

class SyntaxHighlighter
{
public static function patch () {
public static function patch (onComplete:()->Void) {
Sys.println("Applying syntax highlighting ...");

// Convert CSON grammar to json for vscode-textmate
Expand Down Expand Up @@ -41,6 +41,8 @@ class SyntaxHighlighter
var baseStyle = File.getContent(path);
var syntaxStyle = highlighters["haxe"].runCss();
File.saveContent(path, baseStyle + syntaxStyle);

onComplete();
});
}
}
Expand Down

0 comments on commit 52a4ba6

Please sign in to comment.