Skip to content

Commit

Permalink
fix cabal generation
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-martin committed Jan 7, 2025
1 parent c4c5d50 commit db5fc18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ regenerate: clean fetch convert-to-json generate-haskell-code fix-nulls format-g

# Delete all generated code
clean:
rm -rf spec.json spec.yaml recurly-client
rm -rf spec.json spec.yaml recurly-client/src recurly-client/*.cabal

# Download the OpenAPI spec
fetch:
Expand All @@ -29,16 +29,17 @@ format-generated-code:
fourmolu -i recurly-client/src --unsafe

patch-cabal-file:
# Use version.txt as the version in the .cabal file
VERSION=$(cat version.txt)

sed "s|^version: *.*$|version: ${VERSION}|" recurly-client/recurly-client.cabal \
grep -v "^version:" recurly-client/recurly-client.cabal \
> recurly-client/recurly-client.cabal.tmp.1

# First line contains cabal-version
head -n1 recurly-client/recurly-client.cabal.tmp.1 \
> recurly-client/recurly-client.cabal.tmp.2

# Set version
echo -n "version: " >> recurly-client/recurly-client.cabal.tmp.2
cat ./version.txt >> recurly-client/recurly-client.cabal.tmp.2

# Add extra top-level fields
cat ./cabal-fields.txt >> recurly-client/recurly-client.cabal.tmp.2

Expand Down
2 changes: 1 addition & 1 deletion recurly-client/recurly-client.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.12
version: 0.0.0.1
category: Client, Payments
homepage: https://github.com/freckle/recurly-client
license-file: LICENSE
license: MIT
name: recurly-client
version: 0.0.0.1
build-type: Simple

library
Expand Down

0 comments on commit db5fc18

Please sign in to comment.