Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
fix: test for custom scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
KnisterPeter committed Dec 2, 2016
1 parent 68bc48c commit 07231aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,15 @@ class ConventionalCommitMessage {
}
}

private hasScopes(): boolean {
return Boolean(this.czConfig && (!this.czConfig.allowCustomScopes ||
this.czConfig.scopes && this.czConfig.scopes.length === 0));
}

public async getScope(): Promise<void> {
if (this.next) {
if (this.czConfig && (!this.czConfig.allowCustomScopes || this.czConfig.scopes.length === 0)) {
if (this.czConfig.scopes[0].name !== undefined) {
if (this.hasScopes()) {
if (this.czConfig && this.czConfig.scopes[0].name !== undefined) {
const scopePicks = this.czConfig.scopes.map(scope => ({
label: scope.name as string,
description: ''
Expand Down

0 comments on commit 07231aa

Please sign in to comment.