New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update.sh code refactoring #1033
Conversation
Note that this will also make the updater work for other branches, like:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run pihole -v
at the end and/or at the start so we can see what version the user is on/update to?
# Fetch latest changes and apply | ||
git -C "${directory}" pull --quiet &> /dev/null || ${retVal}=1 | ||
return ${retVal} | ||
git -C "${directory}" pull --quiet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the long version of -C
#1009
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
|
It is run bare for updating. https://github.com/pi-hole/pi-hole/blob/development/pihole#L51 |
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
Right, it's called via a script though, we don't advise users to go to a shell prompt and run |
Does that matter if is called via a script? Would you like to rewrite more fundamental? |
I'm over on MM now, but I think these should be utilities or the beginnings of a library and we handle all the input/output from |
By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?: 10
Code refactoring of the existing
update.sh
without changing its external behavior. Internally, the behavior changes (getting completely independent of GitHub tags).The old logic has been:
Proposed new logic (we discussed about that):
origin
Note that the new behavior is independent of tags but relies on the git log, only. Hence, it is much more reliable and trustworthy.
This template was created based on the work of
udemy-dl
.