aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio A. Vargas <savargasqu+git@unal.edu.co>2021-08-15 02:54:32 +0530
committerGitHub <noreply@github.com>2021-08-15 02:54:32 +0530
commitd28f9c5c0d6a7f600e765463e60caa4294201053 (patch)
tree7ed6501fcea9eebeb6c117b57e36f9b2fb0330bd
parent54ab66e4580daf9d417d82c6604fdcaad1218be5 (diff)
parentf178e54b08e76e2cadfa3151ac9b628087bc7fa4 (diff)
downloadpaq-d28f9c5c0d6a7f600e765463e60caa4294201053.tar.gz
Merge pull request #68 from savq/dev
Dev
-rw-r--r--doc/paq-nvim.txt2
-rw-r--r--lua/paq.lua14
2 files changed, 8 insertions, 8 deletions
diff --git a/doc/paq-nvim.txt b/doc/paq-nvim.txt
index a73f3f3..aebe16a 100644
--- a/doc/paq-nvim.txt
+++ b/doc/paq-nvim.txt
@@ -1,4 +1,4 @@
1*paq-nvim.txt* Package manager for Neovim v0.4.4 Last change: 2021-07-07 1*paq-nvim.txt* Package manager for Neovim >= v0.4.4. Last change: 2021-08-13
2*paq-nvim* 2*paq-nvim*
3*paq* 3*paq*
4 4
diff --git a/lua/paq.lua b/lua/paq.lua
index c3c429a..434c457 100644
--- a/lua/paq.lua
+++ b/lua/paq.lua
@@ -26,7 +26,7 @@ local messages = {
26 err = "failed to remove %s", 26 err = "failed to remove %s",
27 }, 27 },
28 hook = { 28 hook = {
29 ok = "ran hook for %s (%s)", 29 ok = "ran hook for %s",
30 err = "failed to run hook for %s", 30 err = "failed to run hook for %s",
31 } 31 }
32} 32}
@@ -51,7 +51,7 @@ local function report(op, result, name, total)
51 local count = cur and string.format("%d/%d", cur, total) or "" 51 local count = cur and string.format("%d/%d", cur, total) or ""
52 local msg = messages[op][result] 52 local msg = messages[op][result]
53 local p = result == "err" and print_err or print 53 local p = result == "err" and print_err or print
54 p(string.format("Paq [%s] " .. msg, count, name, hook)) 54 p(string.format("Paq [%s] " .. msg, count, name))
55end 55end
56 56
57local function call_proc(process, args, cwd, cb) 57local function call_proc(process, args, cwd, cb)
@@ -61,7 +61,7 @@ local function call_proc(process, args, cwd, cb)
61 stderr:open(log) 61 stderr:open(log)
62 handle = uv.spawn( 62 handle = uv.spawn(
63 process, 63 process,
64 {args=args, cwd=cwd, stdio={nil, nil, stderr}, env={'GIT_TERMINAL_PROMPT=0'}}, 64 {args=args, cwd=cwd, stdio={nil, nil, stderr}, env={"GIT_TERMINAL_PROMPT=0"}},
65 vim.schedule_wrap(function(code) 65 vim.schedule_wrap(function(code)
66 uv.fs_close(log) 66 uv.fs_close(log)
67 stderr:close() 67 stderr:close()
@@ -89,9 +89,9 @@ end
89 89
90local function install(pkg) 90local function install(pkg)
91 if pkg.exists then return update_count("install", "nop", nil, num_pkgs) end 91 if pkg.exists then return update_count("install", "nop", nil, num_pkgs) end
92 local args = pkg.branch 92 local args = {"clone", pkg.url, "--depth=1", "--recurse-submodules", "--shallow-submodules"}
93 and {"clone", pkg.url, "--depth=1", "-b", pkg.branch, pkg.dir} 93 if pkg.branch then vim.list_extend(args, {"-b", pkg.branch}) end
94 or {"clone", pkg.url, "--depth=1", pkg.dir} 94 vim.list_extend(args, {pkg.dir})
95 local post_install = function(ok) 95 local post_install = function(ok)
96 if ok then 96 if ok then
97 pkg.exists = true 97 pkg.exists = true
@@ -130,7 +130,7 @@ local function update(pkg)
130 (cfg.verbose and report or update_count)("update", "nop", pkg.name, num_pkgs) -- blursed 130 (cfg.verbose and report or update_count)("update", "nop", pkg.name, num_pkgs) -- blursed
131 end 131 end
132 end 132 end
133 call_proc("git", {"pull"}, pkg.dir, post_update) 133 call_proc("git", {"pull", "--recurse-submodules", "--update-shallow"}, pkg.dir, post_update)
134end 134end
135 135
136local function remove(packdir) 136local function remove(packdir)