hdoc-tools 0.10.0 → 0.11.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/hdoc-help.js +13 -7
- package/hdoc.js +17 -6
- package/package.json +1 -1
package/hdoc-help.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
(function () {
|
2
|
-
|
2
|
+
'use strict';
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
exports.run = function () {
|
5
|
+
|
6
|
+
// STEVE: The purpose of this function is to output information about hdoc arguments
|
7
|
+
const helpText = `
|
8
8
|
Command Line Usage
|
9
9
|
|
10
10
|
hdoc <command> [switches]
|
@@ -32,10 +32,16 @@ Commands
|
|
32
32
|
- validate
|
33
33
|
Validates the book content
|
34
34
|
|
35
|
+
- bump
|
36
|
+
Updates the semantic version number of the current book. If no options are specified, then the default of patch is applied:
|
37
|
+
- major - updates the major version of the book. i.e. - 1.4.5 would become 2.0.0
|
38
|
+
- minor - updates the minor version of the book. i.e. - 1.4.5 would become 1.5.0
|
39
|
+
- patch (default) - updates the patch version of the book. i.e. - 1.4.5 would become 1.4.6
|
40
|
+
|
35
41
|
Example
|
36
42
|
|
37
43
|
hdoc stats -v
|
38
44
|
`;
|
39
|
-
|
40
|
-
|
45
|
+
console.log(helpText);
|
46
|
+
};
|
41
47
|
})();
|
package/hdoc.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env node
|
1
|
+
#!/usr/bin/env node
|
2
2
|
(async function () {
|
3
3
|
'use strict';
|
4
4
|
|
@@ -25,11 +25,12 @@
|
|
25
25
|
// Default source path to working directory
|
26
26
|
let source_path = process.cwd();
|
27
27
|
let ui_path = path.join(__dirname, 'ui');
|
28
|
-
let
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
let git_token = '',
|
29
|
+
command = '', // Our command to run
|
30
|
+
build_version = '',
|
31
|
+
verbose = false,
|
32
|
+
gen_exclude = false,
|
33
|
+
bump_type = 'patch'; // To generate spellcheck exclusions for all files
|
33
34
|
|
34
35
|
// Get options from command args
|
35
36
|
for (let x = 0; x < process.argv.length; x++) {
|
@@ -39,6 +40,13 @@
|
|
39
40
|
// Third argument is command
|
40
41
|
if (x == 2) {
|
41
42
|
command = process.argv[x];
|
43
|
+
|
44
|
+
if (command === 'bump') {
|
45
|
+
x++;
|
46
|
+
if (x < process.argv.length) {
|
47
|
+
bump_type = process.argv[x];
|
48
|
+
}
|
49
|
+
}
|
42
50
|
continue;
|
43
51
|
}
|
44
52
|
|
@@ -95,6 +103,9 @@
|
|
95
103
|
} else if (command == 'help') {
|
96
104
|
const help = require(path.join(__dirname, 'hdoc-help.js'));
|
97
105
|
help.run();
|
106
|
+
} else if (command == 'bump') {
|
107
|
+
const bump = require(path.join(__dirname, 'hdoc-bump.js'));
|
108
|
+
bump.run(source_path, bump_type);
|
98
109
|
} else {
|
99
110
|
console.log('Unknown command:', command, '\r\n');
|
100
111
|
console.log('Run hdoc help for information regarding this tool.\r\n');
|