Skip to content

Commit

Permalink
feat(app): rename fil flag to tsconfig flag, details for base flag
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Nov 10, 2016
1 parent c394caf commit 3b21bc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Options:
-h, --help output usage information
-V, --version output the version number
-f, --file [file] A tsconfig.json file
-p, --tsconfig [config] A tsconfig.json file
-d, --output [folder] Where to store the generated documentation
-b, --base [base] Base reference of html tag
-b, --base [base] Base reference of html tag <base>
-n, --name [name] Title documentation
-o, --open Open the generated documentation
-s, --serve Serve generated documentation (default http://localhost:8080/)
Expand Down
14 changes: 7 additions & 7 deletions src/app/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export namespace Application {

program
.version(pkg.version)
.option('-f, --file [file]', 'A tsconfig.json file')
.option('-p, --tsconfig [config]', 'A tsconfig.json file')
.option('-d, --output [folder]', 'Where to store the generated documentation (default: ./documentation)', `./documentation/`)
.option('-b, --base [base]', 'Base reference of html tag', '/')
.option('-b, --base [base]', 'Base reference of html tag <base>', '/')
.option('-n, --name [name]', 'Title documentation', defaultTitle)
.option('-o, --open', 'Open the generated documentation', false)
.option('-t, --silent', 'In silent mode, log messages aren\'t logged in the console', false)
Expand Down Expand Up @@ -346,7 +346,7 @@ export namespace Application {
logger.info('Documentation generated in ' + program.output + 'in ' + finalTime + ' seconds');
}
};
$ngdengine.renderGraph(program.file, 'documentation/graph', 'p').then(() => {
$ngdengine.renderGraph(program.tsconfig, 'documentation/graph', 'p').then(() => {
loop();
}, (err) => {
logger.error('Error during graph generation: ', err);
Expand All @@ -371,14 +371,14 @@ export namespace Application {
$configuration.mainData.hideGenerator = true;
}

if (program.file) {
if (!fs.existsSync(program.file)) {
if (program.tsconfig) {
if (!fs.existsSync(program.tsconfig)) {
logger.fatal('"tsconfig.json" file was not found in the current directory');
process.exit(1);
} else {
_file = path.join(
path.join(process.cwd(), path.dirname(program.file)),
path.basename(program.file)
path.join(process.cwd(), path.dirname(program.tsconfig)),
path.basename(program.tsconfig)
);
logger.info('Using tsconfig', _file);

Expand Down

0 comments on commit 3b21bc0

Please sign in to comment.