Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.8k stars 360 forks source link

fix: one liner script doesn't work on windows #1347

Closed 0xAzureDev closed 11 months ago

0xAzureDev commented 11 months ago

Description

Previously, the process of retrieving the ZoKrates release tag resulted in an incorrect URL being used on Windows, leading to installation errors. This pull request addresses the issue by enhancing the tag retrieval process, ensuring the correct URL is utilized for a successful installation.

Changes Made

Replaced the previous tag retrieval method:

tag=$(curl -Ls -w %{url_effective} -o /dev/null "$url/latest" | cut -d'"' -f2 | rev | cut -d'/' -f1 | rev)

With the updated method:

tag=$(curl -Ls -w %{url_effective} -o /dev/null "$url/latest" | awk -F'tag/' '{print $2}')

Explanation

Input: https://github.com/zokrates/zokrates/releases/tag/0.8.7 Output: 0.8.7

Impact

This change ensures that ZoKrates installations on Windows systems using the provided script will correctly fetch the required release tag, preventing 404 errors.

Testing

The pull request has been tested to confirm that the new tag retrieval method functions as expected and resolves the issue of incorrect URL usage for Windows, macOS and Linux.