This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vscode-github): stabilized input of personal access token (#3)
- Loading branch information
1 parent
6453a15
commit f7735fc
Showing
8 changed files
with
91 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
# vscode-github README | ||
|
||
[![Current Version](http://vsmarketplacebadge.apphb.com/version/vscode-github.svg)](https://marketplace.visualstudio.com/items?itemName=KnisterPeter.vscode-github) | ||
[![Install Count](http://vsmarketplacebadge.apphb.com/installs/vscode-github.svg)](https://marketplace.visualstudio.com/items?itemName=KnisterPeter.vscode-github) | ||
|
||
This vscode extension integrates with GitHub. | ||
|
||
## Features | ||
|
||
Current it is possible to do the following: | ||
|
||
* Store your GitHub Personal Access Token | ||
|
||
To use this extension one needs to create a new GitHub Personal Access Token and registers it in the extension. | ||
The 'GitHub: Set Personal Access Token' should be executed for that. | ||
|
||
![GitHub Personal Access Token](./images/github-personal-access-token.png) | ||
|
||
![GitHub Personal Access Token](./images/github-personal-access-token2.png) | ||
|
||
![Set GitHub Personal Access Token](./images/set-personal-access-token.png) | ||
|
||
* Create a new pull request based on the current branch and the last commit | ||
The current branch will be requested to merge into master and the pull request title is the commit message summary. | ||
* Checkout one of the open pull requests | ||
|
||
## Requirements | ||
![Create pull request](./images/create-pull-request.png) | ||
|
||
To use this extension one needs to create a new GitHub Personal Access Token and registers it in the extension. | ||
The 'GitHub: Set Personal Access Token' should be executed for that. | ||
* Checkout one of the open pull requests |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as execa from 'execa'; | ||
|
||
export async function getGitHubOwnerAndRepository(cwd: string): Promise<string[]> { | ||
return execa('git', ['config', '--get-regexp', 'remote\\.origin\\.url'], {cwd}) | ||
.then(result => { | ||
const match = result.stdout.match(/^remote.origin.url git@github.com:(.*?)\/(.*?)(?:.git)?$/); | ||
if (!match) { | ||
throw new Error('Not a github project?'); | ||
} | ||
return [match[1], match[2]]; | ||
}); | ||
} | ||
|
||
export async function getCurrentBranch(cwd: string): Promise<string|undefined> { | ||
return execa('git', ['status', '--porcelain', '--branch'], {cwd}) | ||
.then(result => { | ||
const match = result.stdout.match(/^## (.+?)(?:\.\.\..*)?/); | ||
return match ? match[1] : undefined; | ||
}); | ||
} | ||
|
||
export async function getCommitMessage(cwd: string): Promise<string> { | ||
return execa('git', ['log', '--oneline', '-1'], {cwd}) | ||
.then(result => { | ||
const match = result.stdout.match(/^(?:.+?) (.*)/); | ||
return match ? match[1] : result.stdout; | ||
}); | ||
} | ||
|
||
export async function checkout(cwd: string, branch: string): Promise<void> { | ||
return execa('git', ['checkout', branch], {cwd}) | ||
.then(() => undefined); | ||
} |
This file was deleted.
Oops, something went wrong.