Skip to content

Commit

Permalink
Fix changes overwrite bug
Browse files Browse the repository at this point in the history
And version bump
  • Loading branch information
pbrisbin committed Nov 18, 2022
1 parent fccb941 commit 2fe788c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## [_Unreleased_](https://github.com/freckle/stackctl/compare/v1.1.0.3...main)
## [_Unreleased_](https://github.com/freckle/stackctl/compare/v1.1.0.4...main)

## [v1.1.0.4](https://github.com/freckle/stackctl/compare/v1.1.0.3...v1.1.0.4)

- Fix bug where only the last spec in a multi-spec case had its changes present
in the output file generated by `changes`.

## [v1.1.0.3](https://github.com/freckle/stackctl/compare/v1.1.0.2...v1.1.0.3)

Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: stackctl
version: 1.1.0.3
version: 1.1.0.4
github: freckle/stackctl
license: MIT
author: Freckle Engineering
Expand Down
13 changes: 7 additions & 6 deletions src/Stackctl/Spec/Changes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ runChanges
=> ChangesOptions
-> m ()
runChanges ChangesOptions {..} = do
-- Clear file before starting, as we have to use append for each spec
liftIO $ T.writeFile scoOutput ""

specs <- discoverSpecs

for_ specs $ \spec -> do
Expand All @@ -60,9 +63,7 @@ runChanges ChangesOptions {..} = do
exitFailure
Right mChangeSet -> do
colors <- getColorsStdout
let name = pack $ stackSpecPathFilePath $ stackSpecSpecPath spec
liftIO $ T.writeFile scoOutput $ formatChangeSet
colors
name
scoFormat
mChangeSet
let
name = pack $ stackSpecPathFilePath $ stackSpecSpecPath spec
formatted = formatChangeSet colors name scoFormat mChangeSet
liftIO $ T.appendFile scoOutput $ formatted <> "\n"
2 changes: 1 addition & 1 deletion stackctl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.18
-- see: https://github.com/sol/hpack

name: stackctl
version: 1.1.0.3
version: 1.1.0.4
description: Please see <https://github.com/freckle/stackctl#readme>
homepage: https://github.com/freckle/stackctl#readme
bug-reports: https://github.com/freckle/stackctl/issues
Expand Down

0 comments on commit 2fe788c

Please sign in to comment.