summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-29 18:18:36 +0800
committersumneko <sumneko@hotmail.com>2019-05-29 18:18:36 +0800
commit63145ea05075725ee8fd8e258aa30ffc57ab0cce (patch)
tree8d78d0f54280f2cde48b31f737f549ab5c8ff839
parent3a7996fb1977982c6410d7efff7b402651c6de6c (diff)
downloadlua-language-server-63145ea05075725ee8fd8e258aa30ffc57ab0cce.zip
测试
-rw-r--r--server/publish.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/publish.lua b/server/publish.lua
index ea55a036..768b9766 100644
--- a/server/publish.lua
+++ b/server/publish.lua
@@ -9,13 +9,15 @@ local fs = require 'bee.filesystem'
local subprocess = require 'bee.subprocess'
ROOT = fs.path(rootPath:gsub('[/\\]$', ''))
EXTENSION = ROOT:parent_path()
-print(ROOT:string(), EXTENSION:string())
require 'utility'
local json = require 'json'
local function loadPackage()
local buf = io.load(EXTENSION / 'package.json')
+ if not buf then
+ error(ROOT:string() .. '|' .. EXTENSION:string())
+ end
local package = json.decode(buf)
return package.version
end