From 75d8682474b0460e5308ee1767683f2563257c0c Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 20 Jan 2017 13:43:52 +0100 Subject: [PATCH] e2tool: add root() as replacement for info.root Signed-off-by: Tobias Ulmer --- local/e2tool.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/local/e2tool.lua b/local/e2tool.lua index b325527..d65f20e 100644 --- a/local/e2tool.lua +++ b/local/e2tool.lua @@ -701,7 +701,6 @@ function e2tool.info() end local _current_tool - --- Get current local tool name. -- @param tool Optional new tool name. -- @return Tool name @@ -716,6 +715,20 @@ function e2tool.current_tool(tool) return _current_tool end +local _project_root +--- Get (set) project root. +-- @param project_root Optional. Set to specify project root. +-- @return Project root directory. +function e2tool.root(project_root) + if project_root then + assertIsStringN(project_root) + _project_root = project_root + end + + assertIsStringN(_project_root) + return _project_root +end + --- initialize the local library, load and initialize local plugins -- @param path string: path to project tree (optional) -- @param tool string: tool name (without the 'e2-' prefix) -- 2.39.5