From d1ce4fee5f41b77850a3cbd290d76d61f7efa8af Mon Sep 17 00:00:00 2001 From: Paul Balaji Date: Wed, 13 Mar 2024 11:08:04 +0000 Subject: [PATCH] feat: make exportBuildArtifact compliant with sh (#3412) --- solidity/exportBuildArtifact.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity/exportBuildArtifact.sh b/solidity/exportBuildArtifact.sh index f7f64fca3f..43a7848c35 100755 --- a/solidity/exportBuildArtifact.sh +++ b/solidity/exportBuildArtifact.sh @@ -12,7 +12,7 @@ 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 @@ -20,7 +20,7 @@ else 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