From: Tobias Ulmer Date: Fri, 20 Jan 2017 12:43:52 +0000 (+0100) Subject: e2tool: add root() as replacement for info.root X-Git-Tag: e2factory-2.3.17~58 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=75d8682474b0460e5308ee1767683f2563257c0c;p=e2factory.git e2tool: add root() as replacement for info.root Signed-off-by: Tobias Ulmer --- 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)