Skip to content

Commit b8dbc9c

Browse files
committed
feat(api setting): buildname feature add
addition of the buildName option to allow end-users to build documents to a specific folder name
1 parent 32a9e51 commit b8dbc9c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ var child;
2525

2626
var buildOptions = {
2727
buildDir: process.cwd(),
28-
buildVersion: process.version.slice(1)
28+
buildVersion: process.version.slice(1),
29+
buildName: 'node-documents'
2930
}
3031

3132
var options = process.argv.slice(2);
@@ -44,7 +45,7 @@ if(options[0] !== []) {
4445
if (buildDir.slice(-1) !== docEnd) {
4546
buildDir += docEnd;
4647
}
47-
buildOptions.buildDir = buildDir + 'node-documents';
48+
buildOptions.buildDir = buildDir + buildOptions.buildName;
4849
console.log('Custom build dir: ', buildOptions.buildDir);
4950
}
5051
if (index === options.length - 1) {
@@ -123,7 +124,7 @@ function checkOptions() {
123124
if (buildOptions.buildDir.slice(-1) !== docEnd) {
124125
buildOptions.buildDir += docEnd;
125126
}
126-
buildOptions.buildDir += 'node-documents-' + buildOptions.buildVersion + docEnd;
127+
buildOptions.buildDir += buildOptions.buildName + docEnd;
127128
console.log('NODe API: Building to Directory: %s', buildOptions.buildDir);
128129
checkFolders();
129130
}

example/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ var buildOptions = require('../app/index.js').buildOptions;
1010

1111
// Test version change
1212
buildOptions.buildVersion = '4.4.0'
13+
buildOptions.buildName = 'apidoc'
1314

1415
createDocs();

0 commit comments

Comments
 (0)