diff options
| author | kylo252 <[email protected]> | 2022-06-23 16:12:26 +0200 | 
|---|---|---|
| committer | kylo252 <[email protected]> | 2022-06-23 16:12:26 +0200 | 
| commit | 57bebb5c51a4e93b283a5c65563254b9bfb492cf (patch) | |
| tree | 8a6f0a3596e534002833038bea79d5ede57dc563 /lua/lvim/plugins.lua | |
| parent | f1a672f8674f68d6a610b95fef29ed15339b3cbd (diff) | |
| parent | 8989984b781367b2744c4857e73d8943311db241 (diff) | |
Merge branch 'rolling'
Diffstat (limited to 'lua/lvim/plugins.lua')
| -rw-r--r-- | lua/lvim/plugins.lua | 16 | 
1 files changed, 13 insertions, 3 deletions
| diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua index 9397318e..dd40b967 100644 --- a/lua/lvim/plugins.lua +++ b/lua/lvim/plugins.lua @@ -246,9 +246,19 @@ local core_plugins = {    },  } -for _, entry in ipairs(core_plugins) do -  if not os.getenv "LVIM_DEV_MODE" then -    entry["lock"] = true +local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json") +local content = vim.fn.readfile(default_snapshot_path) +local default_sha1 = vim.fn.json_decode(content) + +local get_default_sha1 = function(spec) +  local short_name, _ = require("packer.util").get_plugin_short_name(spec) +  return default_sha1[short_name] and default_sha1[short_name].commit +end + +for _, spec in ipairs(core_plugins) do +  if not vim.env.LVIM_DEV_MODE then +    -- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode +    spec["commit"] = get_default_sha1(spec)    end  end | 
