Skip to content

Commit

Permalink
feat: make exportBuildArtifact compliant with sh (#3412)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbalaji authored Mar 13, 2024
1 parent f9d67aa commit d1ce4fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solidity/exportBuildArtifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ outputFile="./buildArtifact.json"
echo 'Finding and processing hardhat build artifact...'

# Find most recently modified JSON build artifact
if [[ $OSTYPE == 'darwin'* ]]; then
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-)
else
# 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
if [ ! -f "$jsonFiles" ]; then
echo 'Failed to find build artifact'
exit 1
fi
Expand Down

0 comments on commit d1ce4fe

Please sign in to comment.