Skip to content

Commit

Permalink
fix: remove run key before saving the state
Browse files Browse the repository at this point in the history
  • Loading branch information
saccarosium committed Aug 6, 2023
1 parent 2a77158 commit 557f3e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/paq.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,15 @@ local function lock_load()
end

local function state_write()
-- remove run key since can have a function in it, and
-- json.encode doesn't support functions
local pkgs = vim.deepcopy(packages)
for p, _ in pairs(pkgs) do
pkgs[p].run = nil
end
local file = uv.fs_open(lockfile, "w", 438)
if file then
local ok, result = pcall(vim.json.encode, packages)
local ok, result = pcall(vim.json.encode, pkgs)
if not ok then
error(result)
end
Expand Down

0 comments on commit 557f3e2

Please sign in to comment.