@commitlint/top-level
Advanced tools
Comparing version 8.3.0 to 8.3.2
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -52,3 +53,3 @@ }); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, find_up_1["default"]('.git', { cwd: cwd, type: 'directory' })]; | ||
case 0: return [4 /*yield*/, searchDotGit(cwd)]; | ||
case 1: | ||
@@ -64,2 +65,21 @@ found = _a.sent(); | ||
} | ||
/** | ||
* Search .git, the '.git' can be a file(submodule), also can be a directory(normal) | ||
*/ | ||
function searchDotGit(cwd) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var foundFile, foundDir; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, find_up_1["default"]('.git', { cwd: cwd, type: 'file' })]; | ||
case 1: | ||
foundFile = _a.sent(); | ||
return [4 /*yield*/, find_up_1["default"]('.git', { cwd: cwd, type: 'directory' })]; | ||
case 2: | ||
foundDir = _a.sent(); | ||
return [2 /*return*/, foundFile || foundDir]; | ||
} | ||
}); | ||
}); | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@commitlint/top-level", | ||
"version": "8.3.0", | ||
"version": "8.3.2", | ||
"description": "Lint your commit messages", | ||
@@ -44,3 +44,3 @@ "main": "lib/index.js", | ||
"@types/find-up": "2.1.1", | ||
"@types/node": "12.7.8" | ||
"@types/node": "12.11.2" | ||
}, | ||
@@ -50,3 +50,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "e2edc43219f5005cee5222133859bb0e839c4a05" | ||
"gitHead": "0382070379cfc841da8dc57718d232d1649dac6f" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10781
93