@html-validate/commitlint-config 3.0.29 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commitlint.js +3 -0
- package/bin/install.js +3 -0
- package/dist/commitlint.js +270530 -0
- package/dist/config.js +301 -0
- package/dist/formatter.js +1668 -0
- package/dist/install.js +469 -0
- package/dist/parser-preset.js +479 -0
- package/dist/templates/commit.hbs +30 -0
- package/dist/templates/footer.hbs +0 -0
- package/dist/templates/header.hbs +9 -0
- package/dist/templates/template.hbs +23 -0
- package/package.json +18 -41
- package/cli.js +0 -3
- package/index.js +0 -6
- package/install.js +0 -59
package/install.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const { spawnSync } = require("child_process");
|
|
6
|
-
const isCI = require("is-ci");
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Find the .git directory and return the absolute path.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} cwd - Current working directory
|
|
12
|
-
* @returns {string} Absolute path to git or null if not found.
|
|
13
|
-
*/
|
|
14
|
-
function findGit(cwd) {
|
|
15
|
-
let current = cwd;
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line no-constant-condition
|
|
18
|
-
while (true) {
|
|
19
|
-
const search = path.join(current, ".git");
|
|
20
|
-
|
|
21
|
-
if (fs.existsSync(search)) {
|
|
22
|
-
return path.resolve(current);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* get the parent directory */
|
|
26
|
-
const child = current;
|
|
27
|
-
current = path.dirname(current);
|
|
28
|
-
|
|
29
|
-
/* stop if this is the root directory */
|
|
30
|
-
if (current === child) {
|
|
31
|
-
break;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Calls "git config commit.template .."
|
|
40
|
-
*
|
|
41
|
-
* @returns {void}
|
|
42
|
-
*/
|
|
43
|
-
function configureCommitTemplate() {
|
|
44
|
-
const gitDir = findGit(process.cwd());
|
|
45
|
-
if (!gitDir) {
|
|
46
|
-
console.warn("Failed to locate git directory, skipping gitmessage");
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const relPath = path.relative(gitDir, __dirname);
|
|
51
|
-
const gitmessage = path.join(relPath, "gitmessage");
|
|
52
|
-
const args = ["config", "commit.template", gitmessage];
|
|
53
|
-
console.info(`git ${args.join(" ")}`);
|
|
54
|
-
spawnSync("git", args);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (!isCI) {
|
|
58
|
-
configureCommitTemplate();
|
|
59
|
-
}
|