Skip to content

Conversation

@Perlover
Copy link
Contributor

@Perlover Perlover commented Jan 22, 2026

Fix arithmetic expression crash in project-install.sh

Script crashed with set -e due to post-increment returning exit code 1
when chain_depth was 0. Changed to pre-increment so expression always
returns non-zero value.

#311

Script crashed with `set -e` due to post-increment returning exit code 1
when chain_depth was 0. Changed to pre-increment so expression always
returns non-zero value.
@Perlover Perlover changed the title Fix project-install.sh Fix arithmetic expression crash in project-install.sh Jan 22, 2026
@jed2nd
Copy link

jed2nd commented Jan 22, 2026

Similar implementation to #312

Replace post-increment ((var++)) with pre-increment ((++var)) to prevent
script termination when using set -e. In bash, ((expr)) returns exit code 1
when the expression evaluates to 0, which happens with post-increment when
the variable is 0.

This fix ensures all commands are installed correctly instead of only the
first one.
@mathieu-ducrot
Copy link

mathieu-ducrot commented Jan 23, 2026

I confirm that without @Perlover changes i wasn't able to run project-install.sh on my ubuntu 24.04.3.
But it's was ok afterward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants