Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: regenerate script toplevel resolution #873

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

mrnossiom
Copy link
Contributor

@mrnossiom mrnossiom commented Aug 19, 2024

Hi 👋🏻,

I wanted to check on #870. (EDIT: sorry for linking the issue without a real connection)

When loading the regenerate_test_rustdocs.sh script, it would just output Generating rustdoc with: cargo 1.80.1 (376290515 2024-07-16) and then exit promptly. Upon closer examination, the TOPLEVEL variable would end up having two values, thus silently crashing the rest of the program.

Though my bash knowledge is limited, I think this is what is happening:

git rev-parse --show-toplevel 2>/dev/null || cd -- "$(dirname -- "${BASH_SOURCE[0]}" )" &>/dev/null && cd -- .. &>/dev/null && pwd
# is either (in git repo)
true || true && true && true # execs both git and pwd
false || true && true && true # execs only pwd

Wrapping the second part of the logical OR resolves the issue.

It seems that #856, introduced this and was recently committed.

@obi1kenobi
Copy link
Owner

Yup, I definitely messed that up — thank you so much!

@obi1kenobi obi1kenobi merged commit e66a9ad into obi1kenobi:main Aug 19, 2024
33 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants