Skip to content

Commit

Permalink
Fix syntax error gen.sh (#341)
Browse files Browse the repository at this point in the history
**Description:**

This PR addresses a small syntax error in the bash script. The original
line:

```bash
for file in "${@: 2}"; do
```

has an unnecessary space after the colon. The corrected line is:

```bash
for file in "${@:2}"; do
```

**Explanation of the fix:**

In bash scripting, the correct syntax for parameter expansion with the
`@` symbol is `"{@:2}"` (without the space). The presence of the space
could lead to unexpected behavior or errors in some bash environments.
This fix ensures that the script will function as intended.

**Why this is important:**

While this issue may not always cause a failure, adhering to the correct
syntax ensures compatibility across different bash versions and prevents
potential bugs, especially when dealing with positional parameters in
loops. This change improves the stability and reliability of the script.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Minor syntax improvement in the script for better adherence to
standard practices.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
0xminds authored Nov 24, 2024
1 parent 7a12768 commit 13e4bbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ forge build -C lib/openzeppelin-contracts/contracts/proxy > /dev/null

cd "$1"

for file in "${@: 2}"; do
for file in "${@:2}"; do
mkdir -p ../wrappers/"${file}"
contractName=$(basename "${file}" .sol)

Expand Down

0 comments on commit 13e4bbf

Please sign in to comment.