-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76735aa
commit 88c3a3f
Showing
7 changed files
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# cqg-cms-api-proto | ||
|
||
This package contains Haskell modules generated from the protobuf files for CQG's [CMS API](https://partners.cqg.com/api-resources/cms-api/documentation). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash | ||
# nixos-24.05 as of 2024-06-01 | ||
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/805a384895c696f802a9bf5bf4720f37385df547.tar.gz | ||
#! nix-shell -p curl | ||
#! nix-shell -p unzip | ||
#! nix-shell -p protobuf | ||
#! nix-shell -p haskellPackages.proto-lens-protoc | ||
# | ||
# This script will download and regenerate the CQG API Protobuf files. | ||
|
||
# Make sure shellcheck understands that this is a Bash script: | ||
# shellcheck shell=bash | ||
|
||
set -eumo pipefail | ||
|
||
shopt -s globstar | ||
|
||
# Download the protobuf files | ||
|
||
rm -rf cqg-cms-api-proto/proto/* | ||
curl 'https://partners.cqg.com/cms/protocol/production/CMS.zip' > cqg-cms-api-proto/proto/CMS.zip | ||
unzip cqg-cms-api-proto/proto/CMS.zip -d cqg-cms-api-proto/proto/ | ||
rm cqg-cms-api-proto/proto/CMS.zip | ||
|
||
# Generate the Haskell modules from the protobuf files | ||
|
||
rm -rf cqg-cms-api-proto/src/* | ||
protoc --plugin=protoc-gen-haskell="$(which proto-lens-protoc)" --haskell_out=cqg-cms-api-proto/src/ --proto_path=cqg-cms-api-proto/proto cqg-cms-api-proto/proto/**/*.proto |