Skip to content

Commit d939f49

Browse files
bunsenstraatAniket-Engg
authored andcommitted
Update downloadsoljson.sh
1 parent facb0c5 commit d939f49

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

apps/remix-ide/ci/downloadsoljson.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,22 @@ if ! command -v curl &> /dev/null; then
1010
exit 1
1111
fi
1212

13-
if ! command -v jq &> /dev/null; then
14-
echo "jq could not be found"
15-
exit 1
16-
fi
17-
1813
# Read the defaultVersion from package.json
19-
defaultVersion=$(jq -r '.defaultVersion' package.json)
14+
defaultVersion=$(grep '"defaultVersion"' package.json | awk -F '"' '{print $4}')
2015
echo "Specified version from package.json: $defaultVersion"
2116

2217
# Download the list.json file containing available versions
2318
curl -s https://binaries.soliditylang.org/wasm/list.json > list.json
2419

2520
# Use jq to extract the path for the specified version from the builds array
26-
path=$(jq -r --arg version "$defaultVersion" '.builds[] | select(.path==$version) | .path' list.json)
27-
if [ -z "$path" ]; then
21+
check=$(grep "\"$defaultVersion\"" list.json)
22+
if [ -z "$check" ]; then
2823
echo "The specified version $defaultVersion could not be found in the list"
2924
exit 1
3025
fi
3126

32-
echo "Path for the specified version: $path"
33-
fullPath="https://binaries.soliditylang.org/bin/$path"
27+
echo "Path for the specified version: $defaultVersion"
28+
fullPath="https://binaries.soliditylang.org/bin/$defaultVersion"
3429
echo "Download fullPath: $fullPath"
3530

3631
# Ensure the target directory exists

0 commit comments

Comments
 (0)