guild-operators
guild-operators copied to clipboard
Simplify custom CNODE_VNAME in files and variables
When adding new files to the repository, currently things work pretty well when using prereqs.sh. But if a new script is added to a folder outside of prereqs (eg: to manually add submitapi.sh without wanting to run prereqs), and if the contents include deploying systemd.sh - it gives a potential for users to accidentally deploy with invalid top level folder. Thus, any new script to be added outside of prereqs.sh needs to have checkUpdate run against it.
One of the approaches to simplify this is as below:
- Allow prereqs.sh to set custom environment variables for interactive sessions (like it currently does, using
${CNODE_VNAME}_HOME). - In the
envfile , export static CNODE_HOME variable against$(dirname $0/../..) - The actual scripts should not have to bother about CNODE_VNAME at all, thus - allowing a direct comparison from downloaded github without having to replace environment variables (for STATIC section)
- Reduce VNAME resolution in
checkUpdatefunction
Pushed this as an issue for now, rather than PR - as this needs to be done very carefully - with careful testing thinking of edge cases to not make it a breaking change (prereqs run to update once is fine, but user should not have to re-setup any variables and stuff - hopefully without adding too much of backlog to clear out later 🙂 )