Skip to content

Commit 6adf006

Browse files
committed
Fixed comparison order in bump, diff and validate commands
1 parent 2115616 commit 6adf006

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

terminal/Package/Bump.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ bump flags@(Flags _ _ knownVersions _ _) currentOutline@(Outline.PkgOutline _ _
7171
suggestVersion :: Flags -> Outline.PkgOutline -> Outline.PkgOutline -> Task.Task Exit.Bump ()
7272
suggestVersion flags@(Flags _ root _ (Command.ProjectInfo _ currentSources currentDeps) (Command.ProjectInfo _ publishedSources publishedDeps)) currentOutline@(Outline.PkgOutline _ _ _ vsn _ _ _ _) publishedOutline =
7373
do
74-
oldDocs <- generateDocs root currentOutline currentSources currentDeps
75-
newDocs <- generateDocs root publishedOutline publishedSources publishedDeps
74+
newDocs <- generateDocs root currentOutline currentSources currentDeps
75+
oldDocs <- generateDocs root publishedOutline publishedSources publishedDeps
7676
let changes = Diff.diff oldDocs newDocs
7777
let newVersion = Diff.bump changes vsn
7878
Task.io $

terminal/Package/Diff.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ data Flags = Flags
4141
deriving (Show)
4242

4343
run :: Flags -> IO ()
44-
run flags@(Flags _ _ firstPackage secondPackage) =
44+
run flags@(Flags _ _ currentPackage publishedPackage) =
4545
Reporting.attempt Exit.diffToReport $
46-
case (Command._project_outline firstPackage, Command._project_outline secondPackage) of
47-
(Outline.Pkg firstOutline, Outline.Pkg secondOutline) ->
48-
Task.run (diff flags firstOutline secondOutline)
46+
case (Command._project_outline currentPackage, Command._project_outline publishedPackage) of
47+
(Outline.Pkg currentOutline, Outline.Pkg publishedOutline) ->
48+
Task.run (diff flags currentOutline publishedOutline)
4949
_ ->
5050
error "Received outlines are in the wrong format"
5151

@@ -55,10 +55,10 @@ type Task a =
5555
Task.Task Exit.Diff a
5656

5757
diff :: Flags -> Outline.PkgOutline -> Outline.PkgOutline -> Task ()
58-
diff (Flags _ root (Command.ProjectInfo _ firstSources firstSolution) (Command.ProjectInfo _ secondSources secondSolution)) firstOutline secondOutline =
58+
diff (Flags _ root (Command.ProjectInfo _ currentSources currentSolution) (Command.ProjectInfo _ publishedSources publishedSolution)) currentOutline publishedOutline =
5959
do
60-
oldDocs <- generateDocs root firstOutline firstSources firstSolution
61-
newDocs <- generateDocs root secondOutline secondSources secondSolution
60+
newDocs <- generateDocs root currentOutline currentSources currentSolution
61+
oldDocs <- generateDocs root publishedOutline publishedSources publishedSolution
6262
writeDiff oldDocs newDocs
6363

6464
-- GENERATE DOCS

terminal/Package/Validate.hs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,19 @@ validate (Flags root knownVersions (Command.ProjectInfo currentOutline currentSo
4444
Task.throw Exit.ValidateApplication
4545
(Outline.Pkg currentPkgOutline@(Outline.PkgOutline _ _ _ _ _ _ _ _), Nothing) ->
4646
do
47-
_ <- verifyBuild root currentPkgOutline currentSources currentDeps
47+
_ <- buildProject root currentPkgOutline currentSources currentDeps
4848
Task.io $ putStrLn "Everything looks good!"
4949
(Outline.Pkg (Outline.PkgOutline _ _ _ _ _ _ _ _), Just (Command.ProjectInfo (Outline.App _) _ _)) ->
5050
error "Previous version is app"
5151
(Outline.Pkg currentPkgOutline@(Outline.PkgOutline _ _ _ vsn _ _ _ _), Just (Command.ProjectInfo (Outline.Pkg previousOutline) previousSources previousDeps)) ->
5252
do
53-
currentDocs <- verifyBuild root currentPkgOutline currentSources currentDeps
53+
currentDocs <- buildProject root currentPkgOutline currentSources currentDeps
5454
previousDocs <- buildProject root previousOutline previousSources previousDeps
5555

5656
_ <- Task.eio id $ verifyBump vsn currentDocs previousDocs knownVersions
5757

5858
Task.io $ putStrLn "Everything looks good!"
5959

60-
verifyBuild :: FilePath -> Outline.PkgOutline -> Build.Sources -> Map Pkg.Name Details.Dependency -> Task.Task Exit.Validate Docs.Documentation
61-
verifyBuild root outline sources solution =
62-
buildProject root outline sources solution
63-
6460
buildProject :: FilePath -> Outline.PkgOutline -> Build.Sources -> Map Pkg.Name Details.Dependency -> Task.Task Exit.Validate Docs.Documentation
6561
buildProject root pkgOutline@(Outline.PkgOutline _ _ _ _ _ _ _ _) sources solution =
6662
do

0 commit comments

Comments
 (0)