Skip to content

Commit

Permalink
refactor: clean up whitespace in exportBuildArtifact script
Browse files Browse the repository at this point in the history
  • Loading branch information
ljankovic-txfusion committed Jan 22, 2025
1 parent 12e2c9d commit ab346fb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions solidity/exportBuildArtifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ echo 'Finding and processing hardhat build artifact...'

# Find most recently modified JSON build artifact
if [ "$(uname)" = "Darwin" ]; then
# for local flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -f "%m %N" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
# for local flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -f "%m %N" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
else
# for CI flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -c "%Y %n" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
# for CI flow
jsonFiles=$(find "$artifactsDir" -type f -name "*.json" -exec stat -c "%Y %n" {} \; | sort -rn | head -n 1 | cut -d' ' -f2-)
fi

if [ ! -f "$jsonFiles" ]; then
Expand All @@ -28,10 +28,10 @@ if [ ! -f "$jsonFiles" ]; then
fi

# Extract required keys and write to outputFile
if jq -c '{input, solcLongVersion}' "$jsonFiles" >"$outputFileJson"; then
echo "export const buildArtifact = " >"$outputFileJs"
cat "$outputFileJson" >>"$outputFileJs"
echo "export const buildArtifact: any" >"$outputFileTsd"
if jq -c '{input, solcLongVersion}' "$jsonFiles" > "$outputFileJson"; then
echo "export const buildArtifact = " > "$outputFileJs"
cat "$outputFileJson" >> "$outputFileJs"
echo "export const buildArtifact: any" > "$outputFileTsd"
echo 'Finished processing build artifact.'
else
echo 'Failed to process build artifact with jq'
Expand Down Expand Up @@ -75,4 +75,4 @@ if [ "$ZKSYNC" = "true" ]; then
echo 'Failed to process ZKSync build artifact with jq'
exit 1
fi
fi
fi

0 comments on commit ab346fb

Please sign in to comment.