Skip to content

Commit

Permalink
Fixed issues with JSON key usage, variable naming, and redundant semi…
Browse files Browse the repository at this point in the history
…colon in script
  • Loading branch information
mdqst authored Dec 31, 2024
1 parent 48ef4c1 commit ab1ffee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scripts/combined_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ set -eo pipefail

file="$1"
[ -z "$file" ] && echo "Usage: $0 <file>" && exit 1
shift;
basename="$(basename "$file" .sol)"

shift
file_basename="$(basename "$file" .sol)"
contract="${2:-C}"

solc --combined-json generated-sources-runtime "$file" --optimize \
| jq . \
| tee "$basename.json" \
| jq -r ".contracts[\"$file:$contract\"][\"generated-sources-runtime\"][0].contents" \
| tee "$basename.rt.yul"
| tee "$file_basename.json" \
| jq -r ".contracts[\"$file_basename:$contract\"][\"generated-sources-runtime\"][0].contents" \
| tee "$file_basename.rt.yul"

0 comments on commit ab1ffee

Please sign in to comment.