Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell users about cabal.project.local~ #6877

Merged
merged 2 commits into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/CmdConfigure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ configureAction flags@NixStyleFlags {..} _extraArgs globalFlags = do
-- before overwriting
exists <- doesFileExist "cabal.project.local"
when exists $ do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when exists let's search for the first one of cabal.project.local~, cabal.project.local~0 cabal.project.local~1 etc. until one doesn't.

Note: we need to change this to take into account --project-file as we on it. I wonder if there's an issue about that too.

notice verbosity "'cabal.project.local' file already exists. Now overwriting it."
notice verbosity "'cabal.project.local' already exists, backing it up to 'cabal.project.local~'."
copyFile "cabal.project.local" "cabal.project.local~"
writeProjectLocalExtraConfig (distDirLayout baseCtx)
cliConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cabal v2-configure
'cabal.project.local' file already exists. Now overwriting it.
'cabal.project.local' already exists, backing it up to 'cabal.project.local~'.
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import Test.Cabal.Prelude
main = cabalTest $
withSourceCopy $ do
r <- cabal' "v2-configure" []
assertOutputContains "Now overwriting it" r
assertOutputContains "backing it up to" r