- 
                Notifications
    You must be signed in to change notification settings 
- Fork 9
Automatic installation of GitHub CLI, Git and Git LFS #34
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
base: main
Are you sure you want to change the base?
Conversation
Add automated installation of GitHub CLI (if not available), Microsoft's Git and Git LFS in regards to the operating system (Windows, Mac OS)
Add "requests" and "urllib3" package to handle GitHub CLI download
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.
Looks good for the most part, the upgraded download logic looks nice!
| except FileNotFoundError: | ||
| return False | ||
|  | ||
| def install_gh_cli(): | 
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.
GitHub CLI is expected to be in .github/git/gh.exe,  please see pbgh.py. Though, I suppose we need to do some work to fix support for GitHub CLI while using repos on GitLab, since it uses GitLab CLI automatically in that case. So maybe forcing GitHub CLI is good there.
| verboselogs = "*" | ||
| crcmod = "*" | ||
| tinyaes = "*" | ||
| requests = "*" | 
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 use urllib.request in other places, so if we are including the requests package, we should probably avoid importing urllib.request throughout.
        
          
                pbsync/__main__.py
              
                Outdated
          
        
      |  | ||
| default_config_name = "PBSync.xml" | ||
|  | ||
| retry_strategy = Retry( | 
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.
Maybe make a new pbhttp module in pbpy?
Add separate module for handling HTTP requests
I have added requests and urllib3 packages in the first place to handle downloading files from Internet via Python script. Then I have rewritten code in pbsync/main.py to allow PBSync for automatic installation of GitHub CLI, Microsoft's Git and Git LFS. For more information see ticket #7.
First, the program checks whether GitHub CLI isn't already installed. If yes, then it proceeds forward. Otherwise, it starts downloading installation file for GH CLI. When downloading fails once, the program will repeat the process 5 times at most until passing. If download and installation process is successful, then Git and Git LFS are installed via GitHub CLI and terminal commands.
Workflow is improved, because we don't download separately by a browser. We can also repeat the version check/install process. Since we are repeating GitHub CLI download process, we don't have to terminate it because of temporary problems like no Internet connection.