aboutsummaryrefslogtreecommitdiff
path: root/brunch/lib/commands/product/tool.py
diff options
context:
space:
mode:
Diffstat (limited to 'brunch/lib/commands/product/tool.py')
-rw-r--r--brunch/lib/commands/product/tool.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/brunch/lib/commands/product/tool.py b/brunch/lib/commands/product/tool.py
index d8adc98..85bac18 100644
--- a/brunch/lib/commands/product/tool.py
+++ b/brunch/lib/commands/product/tool.py
@@ -25,6 +25,12 @@ from core import util
class Tool(clicommand.Command):
"""Run a host tool for a given product"""
+ TOOL_PATH_FMT = os.path.join('{0}', 'out', 'out-{1}',
+ 'host', '{2}', 'bin', '{3}')
+
+ def __init__(self, tool_path_fmt=TOOL_PATH_FMT):
+ self._tool_path_format = tool_path_fmt
+ super(Tool, self).__init__()
@staticmethod
def Args(parser):
@@ -42,8 +48,8 @@ class Tool(clicommand.Command):
store = config.ProductStore(args.product_path)
# TODO(wad) Add arch detection.
- tool_path = os.path.join(args.product_path, 'out', 'out-%s' % store.device,
- 'host', 'linux-x86', 'bin', args.tool)
+ tool_path = self._tool_path_format.format(
+ args.product_path, store.device, 'linux-x86', args.tool)
if not os.path.isfile(tool_path):
print "The product must be built once prior to using %s." % args.tool
return 1