Closed greywarl0ck closed 3 years ago
Check response here - it occurs because you have script updated but not the env file from github, you would only encounter this when not following the official guild documentation.
hm... No. I have the current version of the env file. I made a git clone, then put my values into CNODE_HOME, CNODE_PORT, CONFIG, SOCKET, TOPOLOGY. And then I ran ./cntools.sh.
The checkUpdate function is inside the env and the following line is nowhere to be found in the cntools.sh file: source "${PARENT}"/env it means, when you call this function, you should explicitly specify the file from which it is called
I could be wrong, because I haven't understood your code completely, but in my opinion this line is wrong.
env file is sourced in offline mode before trying to run the update check so update function should be available if present in env. https://github.com/cardano-community/guild-operators/blob/master/scripts/cnode-helper-scripts/cntools.sh#L65
OK,
If I do the following
. "${PARENT}"/env offline #&>/dev/null # ignore any errors, re-sourced later
then I get a normal exception
You do not have a cardano-cli binary available in $PATH.
./cntools.sh: line 69: checkUpdate: command not found
Which tells me what the problem. but the original code doesn't let me see this. so if an error occurs when loading an env file, it won't show up, and the command on line 69 won't run. but if line 69 had been changed as i suggest, then we had an error with $PATH, but no unplanned error on line 69
Try out the code in alpha branch (check usage instructions) for code changes, tho its upgraded for 1.27
yes, now if there is no cardano binary path in $PATH, cntools.sh tells me this, not an error on line 69.
I run cntools.sh and get the following error: ./cntools.sh: line 69: checkUpdate: command not found
on this line the following command:
! checkUpdate env && myExit 1
I think it should be like this:! . "${PARENT}"/env checkUpdate env && myExit 1