summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-06-06 10:38:40 +0800
committerOpportunityLiu <[email protected]>2019-06-06 14:37:22 +0800
commit50b021eced621efc6c2971d032e1592272ca045b (patch)
treeb138ed008154cadc8360785cc413b97f2f095866
parente9b11611ea2c2c2c892938deee37797a5d10d296 (diff)
use get.sh
-rw-r--r--xmake/actions/update/main.lua17
-rw-r--r--xmake/scripts/update-script.sh5
2 files changed, 5 insertions, 17 deletions
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index 701c56b5c..6d3e6ce0d 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -200,14 +200,6 @@ end
function _install_script(sourcedir)
cprintf("\r${yellow} => ${clear}install script to %s .. ", os.programdir())
- local source = path.join(sourcedir, "xmake")
- local dirname = path.filename(os.programdir())
- if dirname ~= "xmake" then
- local target = path.join(sourcedir, dirname)
- os.mv(source, target)
- source = target
- end
-
local ok = try
{
function ()
@@ -215,13 +207,14 @@ function _install_script(sourcedir)
local script_original = path.join(os.programdir(), "scripts", "update-script.bat")
local script = os.tmpfile() .. ".bat"
os.cp(script_original, script)
- local params = { "/c", script, os.programdir(), source }
+ local params = { "/c", script, os.programdir(), path.join(sourcedir, "xmake") }
os.tryrm(script_original .. ".bak")
- local access = os.trymv(script_original, script_original .. ".bak")
+ local access = os.trycp(script_original, script_original .. ".bak")
return _run_win_v("cmd", params, not access)
else
- local script = path.join(os.programdir(), "scripts", "update-script.sh")
- return _sudo_v("sh", { script, os.programdir(), source })
+ os.cd(sourcedir)
+ os.vrun("./scripts/get.sh __local__ __install_only__")
+ return true
end
end,
catch
diff --git a/xmake/scripts/update-script.sh b/xmake/scripts/update-script.sh
deleted file mode 100644
index 9e79ec71a..000000000
--- a/xmake/scripts/update-script.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-cd "$1"
-rm actions core includes languages modules platforms plugins repository rules scripts templates themes -rf
-cp "$2" "$1/.." -rf \ No newline at end of file