diff options
| author | ruki <[email protected]> | 2015-05-18 11:49:35 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-18 11:49:35 +0800 |
| commit | 4e9518e18e817551772545092b186e8f570b4a0f (patch) | |
| tree | 2713e11d64364b07d85181b91665debd69b137c2 /xmake/scripts/base/main.lua | |
| parent | c94218b659016aadb3f1dc63cc82c3ae8dc14320 (diff) | |
update tbox and enter the project directory
Diffstat (limited to 'xmake/scripts/base/main.lua')
| -rw-r--r-- | xmake/scripts/base/main.lua | 12 |
1 files changed, 10 insertions, 2 deletions
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") |
