From 4e9518e18e817551772545092b186e8f570b4a0f Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 18 May 2015 11:49:35 +0800 Subject: update tbox and enter the project directory --- xmake/scripts/base/main.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xmake/scripts/base/main.lua') diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index 1eb0fc5e9..e746e5f01 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -24,6 +24,7 @@ local main = main or {} -- load modules +local os = require("base/os") local path = require("base/path") local utils = require("base/utils") local option = require("base/option") @@ -289,8 +290,8 @@ function main._done_option() assert(config._CONFIGS) -- init the build directory - if config._CONFIGS.buildir and not path.is_absolute(config._CONFIGS.buildir) then - config._CONFIGS.buildir = path.absolute(config._CONFIGS.buildir, xmake._PROJECT_DIR) + if config._CONFIGS.buildir and path.is_absolute(config._CONFIGS.buildir) then + config._CONFIGS.buildir = path.relative(config._CONFIGS.buildir, xmake._PROJECT_DIR) end assert(config._CONFIGS.buildir) @@ -329,6 +330,13 @@ function main._done_option() -- dump config config.dump() + + -- enter the project directory + if not os.cd(xmake._PROJECT_DIR) then + -- error + utils.error("not found project: %s!", xmake._PROJECT_DIR) + return false + end -- done action return action.done(options._ACTION or "build") -- cgit v1.3.1