-
Notifications
You must be signed in to change notification settings - Fork 18
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
upstream tldr mindlessly changed master
to main
#49
Comments
Tested in my local environment, still works. tldr-pages repo still has master branch and it is even with main. But I agree that we should switch to use the main branch in the future. |
Yeah, apparently official notice was at https://github.com/tldr-pages/tldr/releases/tag/v1.5b . They seem pretty adamant that you should be using On the other hand, a
The only thing I can figure out is that they expect you to simply store the zip file, and use (The perfect thing would be generating Should I open a bug on the alleged "MUST" issue to document it, or is this enough? |
I cooked up the following workaround for 0.7.0. This adds an optional config key called repo_branch, in case your in-house tldr repo uses a different branch name, and sets the branch to "main" if you don't set the key. Works on my rig. root@mybox:/usr/lib/python3/dist-packages/tldr# diff config.py-DIST config.py
36a37,38
> if not 'repo_branch' in config.keys():
> config['repo_branch'] = 'main' root@mybox:/usr/lib/python3/dist-packages/tldr# diff cli.py-DIST cli.py
110a111
> repo_branch = get_config()['repo_branch']
114c115,116
< local = subprocess.check_output('git rev-parse master'.split()).strip()
---
> local_cmd = 'git rev-parse ' + repo_branch
> local = subprocess.check_output(local_cmd.split()).strip()
120c122,123
< subprocess.check_call('git checkout master'.split())
---
> checkout_cmd = 'git checkout ' + repo_branch
> subprocess.check_call(checkout_cmd.split()) |
tldr.py/tldr/cli.py
Lines 139 to 145 in 4f8065a
Update your code to participate in the performance.
The text was updated successfully, but these errors were encountered: