From 7c068ee8ef18c0ab6fbbad373eeeb691fd812bc8 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 27 Mar 2018 01:13:50 -0700 Subject: [PATCH] build: add command to output currently configured board ./waf board now shows what's the currently configured board. Same as grep "'board':" build/.lock-waf* but in a more pleasant way. --- wscript | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wscript b/wscript index 56aef4a188..754075ad12 100644 --- a/wscript +++ b/wscript @@ -253,6 +253,17 @@ def collect_dirs_to_recurse(bld, globs, **kw): def list_boards(ctx): print(*boards.get_boards_names()) +def board(ctx): + env = ConfigSet.ConfigSet() + try: + p = os.path.join(Context.out_dir, Build.CACHE_DIR, Build.CACHE_SUFFIX) + env.load(p) + except: + print('No board currently configured') + return + + print('Board configured to: {}'.format(env.VARIANT)) + def _build_cmd_tweaks(bld): if bld.cmd == 'check-all': bld.options.all_tests = True