on master help sign in
Make the "upgrade dependencies?" question nicer to read
020fe37Evan Czaplicki
builder/src/Elm/Install.hs+16−10
@@ -70,18 +70,10 @@ attemptElmJsonChange root oldProject toString changes =
70 do liftIO $ putStrLn "It is already installed!"
70 do liftIO $ putStrLn "It is already installed!"
71
71
72 PromoteTest newProject ->
72 PromoteTest newProject ->
73− attempt newProject $ D.vcat $
73+ attempt newProject $ requestPromotion "\"test-dependencies\""
74− [ "I found it in your elm.json file!"
75− , "In \"test-dependencies\" though."
76− , "Should I move it into \"dependencies\" for more general use? [Y/n]: "
77− ]
78
74
79 PromoteTrans newProject ->
75 PromoteTrans newProject ->
80− attempt newProject $ D.vcat $
81− [ "I found it in your elm.json file!"
82− , "In \"transitive-dependencies\" though."
76+ attempt newProject $ requestPromotion "\"transitive-dependencies\""
83− , "Should I move it into \"dependencies\" for more general use? [Y/n]: "
84− ]
85
77
86 Changes changeDict newProject ->
78 Changes changeDict newProject ->
87 let
79 let
@@ -96,6 +88,20 @@ attemptElmJsonChange root oldProject toString changes =
96 ]
88 ]
97
89
98
90
91+requestPromotion :: D.Doc -> D.Doc
92+requestPromotion theWrongPlace =
93+ D.vcat
94+ [ D.fillSep
95+ ["I","found","it","in","your","elm.json","file!"
96+ ,"In",D.dullyellow theWrongPlace,"though."
97+ ]
98+ , D.fillSep
99+ ["Should","I","move","it","into",D.green "\"dependencies\""
100+ ,"for","more","general","use?","[Y/n]: "
101+ ]
102+ ]
103+
104+
99
105
100-- MAKE PLANS
106-- MAKE PLANS
101
107