From 22f5a9da160bc3f66c7011f4112676c2422db532 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Mon, 17 Oct 2016 15:41:37 -0700 Subject: [PATCH] Add initial Lime config command --- lime/project/Command.hx | 1 + tools/CommandLineTools.hx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lime/project/Command.hx b/lime/project/Command.hx index 0994f245d..248fb8079 100644 --- a/lime/project/Command.hx +++ b/lime/project/Command.hx @@ -5,6 +5,7 @@ enum Command { BUILD; CLEAN; + CONFIG; DEPLOY; DISPLAY; UPDATE; diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index 1baf0b161..3408c11d3 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -89,6 +89,10 @@ class CommandLineTools { displayHelp (); + case "config": + + displayConfig (); + case "setup": platformSetup (); @@ -755,6 +759,31 @@ class CommandLineTools { } + private function displayConfig ():Void { + + var config = getLimeConfig (); + + if (words.length == 0) { + + LogHelper.print (File.getContent (Sys.getEnv ("LIME_CONFIG"))); + + } else { + + if (config.defines.exists (words[0])) { + + LogHelper.print (config.defines.get (words[0])); + + } else { + + LogHelper.error ("\"" + words[0] + "\" is undefined"); + + } + + } + + } + + private function displayHelp ():Void { displayInfo (); @@ -1151,6 +1180,8 @@ class CommandLineTools { } + Sys.putEnv ("LIME_CONFIG", config); + } if (FileSystem.exists (config)) {