matter-labs / zksync-cli

CLI tool that simplifies ZKsync development
MIT License
166 stars 96 forks source link

Add validation check Forge version to ensure It's `foundry-zksync` Forge #137

Closed dutterbutter closed 1 month ago

dutterbutter commented 5 months ago

Description

Currently, the script checks for the installation of Forge using the command forge --version. However, it does not verify if the installed Forge is from the foundry-zksync repository. This can lead to issues if a different version of Forge is installed.

Suggested Solution

Add a check to ensure that the installed Forge is from the foundry-zksync repository. This can be done by verifying the version or source of the installation.

Code Reference

const isInstalled = await executeCommand("forge --version", { silent: true });
if (!isInstalled) {
  spinner.fail(
    "Forge is not installed from the `foundry-zksync` repository. Please visit the official installation guide at https://github.com/matter-labs/foundry-zksync and follow the instructions to install it. Once installed, try running the command again."
  );
  return;
}

Additional Resources