File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ initProject mresolver initOpts = do
6969 let dest = currDir </> stackDotYaml
7070 dest' = toFilePath dest
7171 exists <- fileExists dest
72- when exists $ error " Invariant violated: in toBuildConfig's Nothing branch, and the stack.yaml file exists "
72+ when exists $ error " Refusing to overwrite existing stack.yaml, please delete before running stack init "
7373
7474 cabalfps <- findCabalFiles currDir
7575 $ logInfo $ " Writing default config file to: " <> T. pack dest'
@@ -92,7 +92,9 @@ initProject mresolver initOpts = do
9292 { peValidWanted = True
9393 , peLocation = PLFilePath $
9494 case stripDir currDir $ parent fp of
95- Nothing -> assert False $ toFilePath fp
95+ Nothing
96+ | currDir == parent fp -> " ."
97+ | otherwise -> assert False $ toFilePath $ parent fp
9698 Just rel -> toFilePath rel
9799 , peSubdirs = []
98100 }
You can’t perform that action at this time.
0 commit comments