summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authoractboy168 <actboy168@gmail.com>2019-06-11 10:28:32 +0800
committeractboy168 <actboy168@gmail.com>2019-06-11 10:28:32 +0800
commitf7d706a8bdba943652d7d693bc8cf421f70ee1f4 (patch)
tree7fb809652ebc8c8c96edac1443ffc0b9f8368484 /make
parentef59c183fab99c477e8e5ff00a963b54d3dbdd90 (diff)
downloadlua-language-server-f7d706a8bdba943652d7d693bc8cf421f70ee1f4.zip
修正一个小错误
Diffstat (limited to 'make')
-rw-r--r--make/copy.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/make/copy.lua b/make/copy.lua
index 733ac883..4c718117 100644
--- a/make/copy.lua
+++ b/make/copy.lua
@@ -49,11 +49,17 @@ if not fs.exists(extensionDir) then
return
end
-if pcall(fs.remove_all, extensionDir / "server" / "bin-bak") then
- fs.rename(extensionDir / "server" / "bin", extensionDir / "server" / "bin-bak")
-else
- fs.remove_all(extensionDir / "server" / "bin")
+local binDir = extensionDir / "server" / "bin"
+local bakDir = extensionDir / "server" / "bak"
+
+if fs.exists(binDir) then
+ if pcall(fs.remove_all, bakDir) then
+ fs.rename(binDir, bakDir)
+ else
+ fs.remove_all(binDir)
+ end
end
-copy_directory(sourceDir / "server" / "bin", extensionDir / "server" / "bin")
+
+copy_directory(sourceDir / "server" / "bin", binDir)
print 'ok'