Socket
Socket
Sign inDemoInstall

gitbook-cli

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-cli - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

6

bin/gitbook.js

@@ -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 @@ );

26

lib/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc