From 8d8dc6d9e032141ee0aa51c16539cc08518167f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 13 Dec 2018 12:39:41 +0800 Subject: =?UTF-8?q?=E5=9C=A8=E5=8F=91=E5=B8=83=E7=9B=AE=E5=BD=95=E6=9B=B4?= =?UTF-8?q?=E6=96=B0node=5Fmodules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/publish.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'server/publish.lua') diff --git a/server/publish.lua b/server/publish.lua index 643faf03..27546eb2 100644 --- a/server/publish.lua +++ b/server/publish.lua @@ -15,9 +15,9 @@ local function loadPackage() return package.version, package.scripts.postinstall end -local function updateNodeModules(postinstall) +local function updateNodeModules(out, postinstall) local current = fs.current_path() - fs.current_path(EXTENSION) + fs.current_path(out) local cmd = io.popen(postinstall) for line in cmd:lines 'l' do print(line) @@ -31,11 +31,11 @@ local function createDirectory(version) return out end -local function copyFiles(out) +local function copyFiles(root, out) return function (dirs) local count = 0 local function copy(relative, mode) - local source = EXTENSION / relative + local source = root / relative local target = out / relative if not fs.exists(source) then error('文件不存在: ' .. tostring(source)) @@ -115,16 +115,12 @@ print('版本号为:' .. version) local out = createDirectory(version) -print('更新NodeModules...') -updateNodeModules(postinstall) - print('清理目录...') removeFiles(out)(true) print('开始复制文件...') -local count = copyFiles(out) { +local count = copyFiles(EXTENSION , out) { ['client'] = { - ['node_modules'] = true, ['out'] = true, ['package-lock.json'] = true, ['package.json'] = true, @@ -145,6 +141,10 @@ local count = copyFiles(out) { } print(('复制了[%d]个文件'):format(count)) + +print('更新NodeModules...') +updateNodeModules(out, postinstall) + print('开始测试...') runTest(out / 'server') @@ -159,4 +159,8 @@ removeFiles(out) { }, } +print('复制到发布目录...') +local count = copyFiles(out, EXTENSION / 'publish' / 'lua-language-server')(true) +print(('复制了[%d]个文件'):format(count)) + print('完成') -- cgit v1.2.3