Skip to content

Commit

Permalink
Merge pull request #13 from erichbehrens/feature/autostart
Browse files Browse the repository at this point in the history
Autostart feature
  • Loading branch information
erichbehrens committed Dec 23, 2017
2 parents e391a94 + ff8a52c commit c1d95c7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Change Log

## v1.4.0
- Autostart extension with VS Code

## v1.3.1
- Update readme with icons

Expand Down
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -94,12 +94,15 @@ Note: white icons can become green or red depending on the pull request state.

- `pullRequestMonitor.showClosed` `boolean`, show or hide closed pull requests

- `pullRequestMonitor.autostart` `boolean`, automatically start the extension

### Default configuration
```json
{
"pullRequestMonitor.refreshInterval": 60,
"pullRequestMonitor.showClosed": false,
"pullRequestMonitor.showMerged": false,
"pullRequestMonitor.autostart": true,
}
```
## Known Issues
Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -3,7 +3,7 @@
"displayName": "GitHub Pull Request Monitor",
"description": "Monitors the status of GitHub pull requests. Checks for conflicts, status reports, reviews and whether the branch is up to date.",
"icon": "icon.png",
"version": "1.3.1",
"version": "1.4.0",
"publisher": "erichbehrens",
"author": "Erich Behrens <me@eb1.it>",
"license": "MIT",
Expand Down Expand Up @@ -76,6 +76,11 @@
"description": "Show closed pull requests",
"type": "boolean",
"default": false
},
"pullRequestMonitor.autostart": {
"description": "Automatically start the extension with VS Code",
"type": "boolean",
"default": true
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/extension.js
Expand Up @@ -100,9 +100,10 @@ function activate(context) {
statusBarItem.show();
context.subscriptions.push(statusBarItem);

let disposable = vscode.commands.registerCommand('PullRequestMonitor.start', () => {
let disposable = vscode.commands.registerCommand('PullRequestMonitor.start', (options = {}) => {
const { silent } = options;
getPullRequests(context);
vscode.window.showInformationMessage('Pull Request Monitor started!');
if (!silent) vscode.window.showInformationMessage('Pull Request Monitor started!');
});

context.subscriptions.push(disposable);
Expand Down Expand Up @@ -161,6 +162,10 @@ function activate(context) {
});

context.subscriptions.push(disposable);

if (vscode.workspace.getConfiguration('pullRequestMonitor').get('autostart') && context.globalState.get('token')) {
vscode.commands.executeCommand('PullRequestMonitor.start', { silent: true });
}
}
exports.activate = activate;

Expand Down

0 comments on commit c1d95c7

Please sign in to comment.