-
Notifications
You must be signed in to change notification settings - Fork 19
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: change master branch to main branch #50
base: dev
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #50 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 183 183
=========================================
Hits 183 183
Continue to review full report at Codecov.
|
Is it compatible if someone download the repo before master renamed to main? Because main branch may not exist and you can't checkout to it. |
How about this:
|
I missed this case, thanks for mentioning it. About
Also, in your example, if How about this? def update():
"""Update to the latest pages."""
repo_directory = get_config()["repo_directory"]
os.chdir(repo_directory)
click.echo("Check for updates...")
try:
local = subprocess.check_output("git rev-parse main".split()).strip()
except subprocess.CalledProcessError:
subprocess.check_call("git fetch -p".split())
subprocess.check_call("git checkout main".split())
local = subprocess.check_output("git rev-parse main".split()).strip()
remote = subprocess.check_output(
"git ls-remote https://github.com/tldr-pages/tldr/ HEAD".split()
).split()[0]
if local != remote:
click.echo("Updating...")
subprocess.check_call("git checkout main".split())
subprocess.check_call("git pull --rebase".split())
build_index()
click.echo("Update to the latest and rebuild the index.")
else:
click.echo("No need for updates.") |
Hi, any updates on this PR? |
To fit this release: https://github.com/tldr-pages/tldr/releases/tag/v1.5b