aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-01-09 20:34:40 -0500
committerAdam Harrison <adamdharrison@gmail.com>2023-01-09 20:34:40 -0500
commita30485f1c754fc795938d3c9cc61c48f2568ffea (patch)
treed1d53b3a8fae8e38f0b0dfac6531c89d1ef67ebf
parent77fc1ec5da2809f0bd74def06658defa3d4c375e (diff)
downloadlite-xl-plugin-manager-0.993.tar.gz
lite-xl-plugin-manager-0.993.zip
Removed .git from remotes.v0.993
-rw-r--r--src/lpm.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index ba81ce0..c521647 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -413,13 +413,14 @@ function common.mkdirp(path)
if target ~= "" and not target:find("^[A-Z]:$") and not system.stat(target) then system.mkdir(target) end
end
end
-function common.copy(src, dst)
+function common.copy(src, dst, hidden)
local src_stat, dst_stat = system.stat(src), system.stat(dst)
if not src_stat then error("can't find " .. src) end
- if dst_stat and dst_stat.type == "dir" then return common.copy(src, dst .. PATHSEP .. common.basename(src)) end
+ if not hidden and common.basename(src):find("^%.") then return end
+ if dst_stat and dst_stat.type == "dir" then return common.copy(src, dst .. PATHSEP .. common.basename(src), hidden) end
if src_stat.type == "dir" then
common.mkdirp(dst)
- for i, file in ipairs(system.ls(src)) do common.copy(src .. PATHSEP .. file, dst .. PATHSEP .. file) end
+ for i, file in ipairs(system.ls(src)) do common.copy(src .. PATHSEP .. file, dst .. PATHSEP .. file, hidden) end
else
local src_io, err1 = io.open(src, "rb")
if err1 then error("can't open for reading " .. src .. ": " .. err1) end
@@ -694,6 +695,8 @@ function Plugin:install(bottle, installing)
system.init(temporary_install_path, url)
system.fetch(temporary_install_path, write_progress_bar)
common.reset(temporary_install_path, branch, "hard")
+ common.rmrf(temporary_install_path .. PATHSEP .. ".git")
+ common.rmrf(temporary_install_path .. PATHSEP .. ".gitignore")
elseif self.path then
local path = install_path .. (self.organization == 'complex' and self.path and system.stat(self.local_path).type ~= "dir" and (PATHSEP .. "init.lua") or "")
local temporary_path = temporary_install_path .. (self.organization == 'complex' and self.path and system.stat(self.local_path).type ~= "dir" and (PATHSEP .. "init.lua") or "")