gitbook-cli
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -82,3 +82,5 @@ #! /usr/bin/env node | ||
runPromise( | ||
manager.ensure(folder || process.cwd()) | ||
manager.ensure(folder || process.cwd(), null, { | ||
install: false | ||
}) | ||
.then(function(v) { | ||
@@ -88,2 +90,4 @@ if (!tags.satisfies(v.version, condition)) { | ||
} | ||
}, function() { | ||
throw new Error('Version required by this book doesn\'t match "' + condition + '"'); | ||
}) | ||
@@ -90,0 +94,0 @@ ); |
@@ -9,2 +9,16 @@ var Q = require('q'); | ||
// Return book version (string) required by a book | ||
function bookVersion(bookRoot) { | ||
var version; | ||
try { | ||
var bookJson = require(path.resolve(bookRoot, 'book')); | ||
version = bookJson.gitbook; | ||
} catch (e) { | ||
if (e.code != 'MODULE_NOT_FOUND') throw e; | ||
} | ||
return version || '*'; | ||
} | ||
// Ensure that a version exists | ||
@@ -22,13 +36,8 @@ // or install it | ||
if (version) return; | ||
try { | ||
var bookJson = require(path.resolve(bookRoot, 'book')); | ||
version = bookJson.gitbook; | ||
} catch (e) { | ||
if (e.code != 'MODULE_NOT_FOUND') throw e; | ||
} | ||
return bookVersion(bookRoot); | ||
}) | ||
// Resolve version locally | ||
.then(function() { | ||
version = version || '*'; | ||
.then(function(_version) { | ||
version = _version; | ||
return local.resolve(version) | ||
@@ -103,2 +112,3 @@ }) | ||
get: getVersion, | ||
getBookVersion: bookVersion, | ||
ensure: ensureVersion, | ||
@@ -105,0 +115,0 @@ ensureAndLoad: ensureAndLoad, |
{ | ||
"name": "gitbook-cli", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"homepage": "https://www.gitbook.com", | ||
@@ -5,0 +5,0 @@ "description": "CLI to generate books and documentation using gitbook", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30893
760