diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-26 15:51:52 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-26 15:51:52 +0200 |
commit | 7a46d3b4977bcd1e115324880a409e88032899a7 (patch) | |
tree | e2294e1054c5301a03f91ae7685ca3efcf92cc9b /lib/cli/getOutputFolder.js | |
parent | 357aa92e31df8f4809ebb01438878ec3ace96ae6 (diff) | |
download | gitbook-7a46d3b4977bcd1e115324880a409e88032899a7.zip gitbook-7a46d3b4977bcd1e115324880a409e88032899a7.tar.gz gitbook-7a46d3b4977bcd1e115324880a409e88032899a7.tar.bz2 |
Add command "serve"
Diffstat (limited to 'lib/cli/getOutputFolder.js')
-rw-r--r-- | lib/cli/getOutputFolder.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/cli/getOutputFolder.js b/lib/cli/getOutputFolder.js new file mode 100644 index 0000000..272dff9 --- /dev/null +++ b/lib/cli/getOutputFolder.js @@ -0,0 +1,17 @@ +var path = require('path'); + +/** + Return path to output folder + + @param {Array} args + @return {String} +*/ +function getOutputFolder(args) { + var bookRoot = path.resolve(args[0] || process.cwd()); + var defaultOutputRoot = path.join(bookRoot, '_book'); + var outputFolder = args[1]? path.resolve(process.cwd(), args[1]) : defaultOutputRoot; + + return outputFolder; +} + +module.exports = getOutputFolder; |