We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c66cf2 commit db84c5dCopy full SHA for db84c5d
run.hxml
@@ -1,3 +1,4 @@
1
--js bin/php_minifier.js
2
+--macro php_minifier.Macro.shebang("node")
3
--main php_minifier.Program
4
share/build.hxml
src/php_minifier/Macro.hx
@@ -0,0 +1,17 @@
+package php_minifier;
+
+#if macro
+import haxe.macro.Compiler;
5
+import haxe.macro.Context;
6
+import sys.io.File;
7
8
+/** Provides initialization macros. **/
9
+@:noDoc abstract class Macro {
10
11
+ /** Adds a shebang to the compiled file. **/
12
+ public static function shebang(executable: String) Context.onAfterGenerate(() -> {
13
+ final path = Compiler.getOutput();
14
+ File.saveContent(path, '#!/usr/bin/env $executable\n${File.getContent(path)}');
15
+ });
16
+}
17
+#end
0 commit comments