diff options
| author | Adel Vilkov <[email protected]> | 2019-04-15 13:03:23 +0300 |
|---|---|---|
| committer | Adel Vilkov <[email protected]> | 2019-04-15 13:03:23 +0300 |
| commit | 84ae318b8c8ab05919126acc596a3104314663c0 (patch) | |
| tree | 22a8a5397a097cf6553373fd276ea6d1f8a24655 | |
| parent | f84cdec174d7bf9b3247397b072e46c1d3b1e2b1 (diff) | |
Removed redundant options, proper boolean config handling
| -rw-r--r-- | xmake/modules/package/manager/clib/install_package.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/xmake/modules/package/manager/clib/install_package.lua b/xmake/modules/package/manager/clib/install_package.lua index 9c2743cbb..d51164f02 100644 --- a/xmake/modules/package/manager/clib/install_package.lua +++ b/xmake/modules/package/manager/clib/install_package.lua @@ -27,18 +27,16 @@ import("lib.detect.find_tool") function configurations() return { - verbose = {description = "enable verbose output", default = "true", values = {"true", "false"}}, - save = {description = "save dependency in project's package.json", default = "false", values = {"true", "false"}}, - save_dev = {description = "save as development dependency in project's package.json", default = "false", values = {"true", "false"}}, + save = {description = "save dependency in project's package.json", default = false, type = "boolean"}, + save_dev = {description = "save as development dependency in project's package.json", default = false, type = "boolean"}, out_dir = {description = "package installation directory relative to project root", default = "clib"}, } end -- install package -- @param name the package name, e.g. clib::clibs/[email protected] --- @param opt the options, .e.g { verbose = true, mode = "release", plat = , arch = , --- remote = "", build = "all", options = {}, imports = {}, build_requires = {}, --- settings = {verbose = "false", out_dir = "deps", save = "true", save_dev = "false"}} +-- @param opt the options, .e.g { verbose = true, +-- settings = {out_dir = "clib", save = false, save_dev = false}} -- -- @return true or false -- @@ -54,13 +52,13 @@ function main(name, opt) dprint("installing %s to %s", name, abs_out) table.insert(argv, "-o " .. abs_out) - if opt.verbose ~= "true" then + if not option.get("verbose") then table.insert(argv, "-q") end - if opt.save == "true" then + if opt.save then table.insert(argv, "--save") end - if opt.save_dev == "true" then + if opt.save_dev then table.insert(argv, "--save-dev") end |
