Commit ce4d7eb6 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Allow addKnownProgram to be used as an update, not just insert

ie preserves any existing user-supplied path and args
parent 6f5155cf
......@@ -286,7 +286,8 @@ restoreProgramConfiguration = addKnownPrograms
-- | Add a known program that we may configure later
addKnownProgram :: Program -> ProgramConfiguration -> ProgramConfiguration
addKnownProgram prog = updateUnconfiguredProgs $
Map.insert (programName prog) (prog, Nothing, [])
Map.insertWith combine (programName prog) (prog, Nothing, [])
where combine _ (_, path, args) = (prog, path, args)
addKnownPrograms :: [Program] -> ProgramConfiguration -> ProgramConfiguration
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment