-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add functionality to retrieve GitHub username and create GitHub…
… repository This commit adds the `getGitHubUsername` function, which retrieves the GitHub username of the user who executed the command. If the username cannot be retrieved, it prompts the user to authenticate with the GitHub CLI or continue without authentication. It also modifies the `createGitHubRepo` function to accept a package name as an argument instead of a repository name. It now logs a message indicating that it is creating a public repository on GitHub using the provided package name. Additionally, this commit updates the `pushToGitHub` function to retry pushing changes if it fails initially. It calls `createGitHubRepo` before retrying and throws an error if both creating the repository and pushing changes fail. Finally, it updates the `ensureConnectedToGitHub` function to use `getGitHubUsername` and adds logic to check if the remote URL is set up. If not, it adds an origin remote pointing to https://github.com/{username}/{packageName}.git. These changes enhance functionality related to interacting with GitHub in order to improve user experience when working with repositories.
- Loading branch information
Showing
1 changed file
with
88 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters