summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-13 22:57:33 +0800
committerruki <[email protected]>2020-05-13 11:45:19 +0800
commitc18bb57110e3017ecab347165c2609cea1083370 (patch)
tree65579f41dbb5d26304917a3e8543dd264e5827d5
parent4a5343c40aafa85b5b1683e333b52190f22955a5 (diff)
remove some ifelse
-rw-r--r--xmake/core/package/repository.lua2
-rw-r--r--xmake/plugins/repo/main.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/package/repository.lua b/xmake/core/package/repository.lua
index acfac9728..2b3e5a7b5 100644
--- a/xmake/core/package/repository.lua
+++ b/xmake/core/package/repository.lua
@@ -121,7 +121,7 @@ end
function repository._cache(is_global)
-- get position
- local position = utils.ifelse(is_global, "global", "local")
+ local position = is_global and "global" or "local"
-- get it from cache first if exists
if repository._CACHE and repository._CACHE[position] then
diff --git a/xmake/plugins/repo/main.lua b/xmake/plugins/repo/main.lua
index e9162496d..e873d0f64 100644
--- a/xmake/plugins/repo/main.lua
+++ b/xmake/plugins/repo/main.lua
@@ -49,7 +49,7 @@ function _add(name, url, branch, is_global)
end
-- trace
- cprint("${color.success}add %s repository(%s): %s%s ok!", ifelse(is_global, "global", "local"), name, url, branch and (" " .. branch) or "")
+ cprint("${color.success}add %s repository(%s): %s%s ok!", (is_global and "global" or "local"), name, url, branch and (" " .. branch) or "")
-- leave environment
environment.leave()
@@ -68,7 +68,7 @@ function _remove(name, is_global)
end
-- trace
- cprint("${bright}remove %s repository(%s): ok!", ifelse(is_global, "global", "local"), name)
+ cprint("${bright}remove %s repository(%s): ok!", (is_global and "global" or "local"), name)
end
-- update repositories
@@ -156,7 +156,7 @@ function _clear(is_global)
end
-- trace
- cprint("${color.success}clear %s repositories: ok!", ifelse(is_global, "global", "local"))
+ cprint("${color.success}clear %s repositories: ok!", (is_global and "global" or "local"))
end
-- list all repositories