Skip to content
Merged
Changes from all commits
Commits
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
32 changes: 16 additions & 16 deletions scripts/chwd
Original file line number Diff line number Diff line change
Expand Up @@ -219,25 +219,25 @@ local function parse_profiles(path)
}
else
if profile then
if not profiles[profile].packages then
if not profiles[profile].packages and not captured_hook then
profiles[profile].packages = line:match(packages_pattern)
else
local hooks = profiles[profile]["hooks"]
if captured_hook == nil then
for hook in pairs(hooks) do
local hook_pattern = '^' .. escape_pattern(hook) .. '%s*=%s*"""'
if line:match(hook_pattern) then
captured_hook = hook
end
end

local hooks = profiles[profile]["hooks"]
if captured_hook == nil then
for hook in pairs(hooks) do
local hook_pattern = '^' .. escape_pattern(hook) .. '%s*=%s*"""'
if line:match(hook_pattern) then
captured_hook = hook
end
end
else
local hook_end = line:match('(.*)"""')
if hook_end then
hooks[captured_hook] = hooks[captured_hook] .. hook_end
captured_hook = nil
else
local hook_end = line:match('(.*)"""')
if hook_end then
hooks[captured_hook] = hooks[captured_hook] .. hook_end
captured_hook = nil
else
hooks[captured_hook] = hooks[captured_hook] .. line .. "\n"
end
hooks[captured_hook] = hooks[captured_hook] .. line .. "\n"
end
end
end
Expand Down
Loading