From 8eea36b297be27641a27c92ed29113622d62f922 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Mon, 15 Apr 2024 00:25:31 +0200 Subject: [PATCH] Added `cne run` --- commandline/Main.hx | 11 +++++++++++ commandline/commands/Compiler.hx | 14 +++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/commandline/Main.hx b/commandline/Main.hx index 8c2f9301..9d5ed778 100644 --- a/commandline/Main.hx +++ b/commandline/Main.hx @@ -70,6 +70,17 @@ class Main { "-debug : Builds a debug build." ].join("\n") }, + { + names: ["run"], + doc: "Runs the last build that was created.", + func: Compiler.run, + dDoc: [ + "Usage: run ", + "", + "This will run the last build that was created.", + "Additional arguments will be sent to the lime compiler." + ].join("\n") + }, { names: ["release"], doc: "Creates a final non debug build, containing all assets.", diff --git a/commandline/commands/Compiler.hx b/commandline/commands/Compiler.hx index 6d09f5aa..08c39f24 100644 --- a/commandline/commands/Compiler.hx +++ b/commandline/commands/Compiler.hx @@ -2,19 +2,23 @@ package commands; class Compiler { public static function test(args:Array) { - __build(args, ["test", getBuildTarget(), "-DTEST_BUILD"]); + __runLime(args, ["test", getBuildTarget(), "-DTEST_BUILD"]); } public static function build(args:Array) { - __build(args, ["build", getBuildTarget(), "-DTEST_BUILD"]); + __runLime(args, ["build", getBuildTarget(), "-DTEST_BUILD"]); } public static function release(args:Array) { - __build(args, ["build", getBuildTarget()]); + __runLime(args, ["build", getBuildTarget()]); } public static function testRelease(args:Array) { - __build(args, ["test", getBuildTarget()]); + __runLime(args, ["test", getBuildTarget()]); } - private static function __build(args:Array, arg:Array) { + public static function run(args:Array) { + __runLime(args, ["run", getBuildTarget()]); + } + + private static function __runLime(args:Array, arg:Array) { for(a in args) arg.push(a); Sys.command("lime", arg);