cardano-community / guild-operators

Artifacts and scripts created by Guild operators
https://cardano-community.github.io/guild-operators
MIT License
353 stars 179 forks source link

[mithril] script update check uses hardcoded cncli.sh #1756

Closed TrevorBenson closed 6 months ago

TrevorBenson commented 6 months ago

Describe the bug The checkUpdate function uses dirname and basename, but the scripts (mithril-client and mithril-signer) that are calling it is passing in cncli.sh. This was copy/pasted from cncli.sh version of the check without modification.

Expected behavior The script should always be updating itself, not any other scripts.

Additional context I'll have a branch and PR ready for this later today once I return home. I'll review all scripts to determine if a general approach/improvement can be made.

On initial review I saw that checkUpdate() was using dirname/basename, but didnt pay close enough attention that it was $1, not $0, and therefore the values were always passed along and not presumed to be the script that actually called the function.

rdlrt commented 6 months ago

Dont see cncli.sh touched in linked PR based on description of this issue / linked PR