Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Lockfile support#1010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
EdenEast wants to merge36 commits intowbthomason:master
base:master
Choose a base branch
Loading
fromEdenEast:feat/lockfile
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
36 commits
Select commitHold shift + click to select a range
a041c15
feat(lockfile): Add Lockfile public interface
EdenEastAug 6, 2022
a3591b0
feat(lockfile): Add lockfile generation
EdenEastAug 6, 2022
dc7eac0
feat(lockfile): Load lockfile data on init if enable
EdenEastAug 6, 2022
bfcdf86
feat(lockfile): Upgrade command implementation
EdenEastAug 6, 2022
c6ea53a
fix(lockfile): Load lockfile after update
EdenEastAug 6, 2022
39bfc28
docs(lockfile): Add lockfile info to readme
EdenEastAug 6, 2022
23b838c
docs(lockfile): Add lockfile docs to help docs
EdenEastAug 7, 2022
36f2990
fix(snapshot): Add lockfile config to snapshot test
EdenEastAug 7, 2022
f9820df
feat(lockfile): Add commit date to lockfile
EdenEastAug 9, 2022
ef4896d
fix(lockfile): Update with `fetch/pull` based on commit
EdenEastAug 12, 2022
6d345d3
fix(git): Depth variable fails if string
EdenEastAug 15, 2022
e2cdf84
feat(display): Add lockfile commit to status
EdenEastSep 3, 2022
ec3c330
fix(lockfile): Handle checkout if lockfile is enabled
EdenEastSep 3, 2022
d358a41
chore: Fix rebase errors
EdenEastSep 5, 2022
6d79ce7
chore: stylua format with updated stylua version
EdenEastSep 6, 2022
ad4361c
fix(lockfile): Use log with vim.notify
EdenEastSep 6, 2022
458f5b4
feat(cmd): Add optional argument parsing for cmds
EdenEastSep 6, 2022
7b1514c
fix(lockfile): Handle checkout failure resolved
EdenEastSep 7, 2022
e5c1c6c
fix(lockfile): Move `upgrade` command to opt arg
EdenEastSep 7, 2022
59f3d1e
feat(cmd): Add optional args to commands
EdenEastSep 7, 2022
affa5a6
fix(lockfile): Override lockfile with opt arg
EdenEastSep 7, 2022
3689ed0
fix(lockfile): Regen on update config option
EdenEastSep 7, 2022
f80bf18
docs(lockfile): Upgrade moved to optional args
EdenEastSep 7, 2022
d91fa6d
feat(cmd): Add path complete for optional args
EdenEastSep 7, 2022
6638714
feat(display): Add ahead behind for commit updates
EdenEastOct 25, 2022
2ee8993
fix: Remove upgrade old update command
EdenEastOct 25, 2022
18c841c
style: Stylua format pass
EdenEastOct 25, 2022
dabbecd
docs: Fix duplicate word in readme
EdenEastNov 21, 2022
de16c82
fix(status): Load lockfile with status command
EdenEastNov 21, 2022
f2629c3
docs: Apply suggestions from code review
EdenEastNov 21, 2022
fcc66ec
docs(help): List optional args to lua api functions
EdenEastNov 21, 2022
ecf5baa
chore(help): Format snapshot command to correct width
EdenEastNov 21, 2022
ee18270
docs(help): Clarify `commit` and lockfile precedence
EdenEastNov 21, 2022
9e160a0
fix(command): Check for string type in filter opts
EdenEastNov 21, 2022
15feddf
fix(lockfile): Emit `PackerComplete` after command
EdenEastNov 22, 2022
191d37b
feat(lockfile): Fire `PackerLockfileDone` autocmd
EdenEastNov 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix(lockfile): Use log with vim.notify
  • Loading branch information
@EdenEast
EdenEast committedNov 28, 2022
commitad4361cc0656c667f84453b3e814d5d5bc4dba89
23 changes: 9 additions & 14 deletionslua/packer.lua
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -743,19 +743,15 @@ packer.upgrade = function(...)
:map_ok(function(ok)
await(a.main)
if next(ok.failed) then
vim.notify(
'Could not update lockfile ' .. vim.inspect(ok.failed),
vim.log.levels.INFO,
{ title = 'packer.nvim' }
)
log.error('Could not update lockfile ' .. vim.inspect(ok.failed))
else
vim.notify('Lockfile updated', vim.log.levels.INFO, { title = 'packer.nvim' })
log.info("Lockfile updated")
lockfile.load()
end
end)
:map_err(function(err)
await(a.main)
vim.notify(err, vim.log.levels.ERROR, { title = 'packer.nvim' })
log.error(err)
end)
end

Expand All@@ -768,28 +764,27 @@ packer.lockfile = function()
local a = require 'packer.async'
local async = a.sync
local await = a.wait
local log = require 'packer.log'
local lockfile = require_and_configure 'lockfile'

local opts, lockfile_plugins = filter_opts_from_plugins(...)
local lockfile_path = opts.path or config.lockfile.path
async(function()
manage_all_plugins()

await(lockfile.update(plugins))
:map_ok(function(ok)
await(a.main)
if next(ok.failed) then
vim.notify(
'Could not update lockfile ' .. vim.inspect(ok.failed),
vim.log.levels.INFO,
{ title = 'packer.nvim' }
)
log.error('Could not update lockfile ' .. vim.inspect(ok.failed))
else
vim.notify('Lockfile updated', vim.log.levels.INFO, { title = 'packer.nvim' })
log.info'Lockfile updated'
lockfile.load()
end
end)
:map_err(function(err)
await(a.main)
vim.notify(err, vim.log.levels.ERROR, { title = 'packer.nvim' })
log.error(err)
end)
end)()
end
Expand Down
12 changes: 3 additions & 9 deletionslua/packer/lockfile.lua
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
local a = require 'packer.async'
local log = require 'packer.log'
local plugin_utils = require 'packer.plugin_utils'
local result = require 'packer.result'
local async = a.sync
Expand All@@ -17,13 +18,6 @@ local lockfile = {
is_updating = false,
}

local function note_warn(msg)
vim.notify(msg, vim.log.levels.WARN, { title = 'packer.nvim' })
end
local function note_err(msg)
vim.notify(msg, vim.log.levels.ERROR, { title = 'packer.nvim' })
end

local function dofile_wrap(file)
return dofile(file)
end
Expand DownExpand Up@@ -69,13 +63,13 @@ end
lockfile.load = function()
local file = config.lockfile.path
if vim.loop.fs_stat(file) == nil then
note_warn(fmt("Lockfile: '%s' not found. Run `PackerLockfile` to generate", file))
log.warn(fmt("Lockfile: '%s' not found. Run `PackerLockfile` to generate", file))
return
end

local ok, res = pcall(dofile_wrap, file)
if not ok then
note_err(fmt("Failed loading '%s' lockfile: '%s'", file, res))
log.error(fmt("Failed loading '%s' lockfile: '%s'", file, res))
else
data = res
end
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp