gitbook-plugin-icp
Advanced tools
Comparing version 0.0.3 to 0.0.4
35
index.js
@@ -5,39 +5,16 @@ var fs = require('fs'); | ||
module.exports = { | ||
book: { | ||
assets: "./assets", | ||
js: ["plugin.js"] | ||
}, | ||
hooks: { | ||
"init": function() { | ||
this.log.debug.ln('init', this.options.pluginsConfig['icp']); | ||
}, | ||
"finish:before": function() { | ||
this.log.debug.ln('finish:before', this.options.pluginsConfig['icp']); | ||
}, | ||
"finish": function() { | ||
this.log.debug.ln('finish', this.options.pluginsConfig['icp']); | ||
// var faviconPathFile = this.options.pluginsConfig['favicon-absolute'] && this.options.pluginsConfig['favicon-absolute'].favicon; | ||
// if (faviconPathFile.startsWith("/")) { | ||
// faviconPathFile = faviconPathFile.substring(1, faviconPathFile.length); | ||
// } | ||
// var faviconAbsolutePath = path.join(process.cwd(), faviconPathFile); | ||
// var gitbookFaviconPath = path.join(process.cwd(), '_book', 'gitbook', 'images', 'favicon.ico'); | ||
// if (faviconPathFile && fs.existsSync(faviconPathFile) && fs.existsSync(gitbookFaviconPath)) { | ||
// fs.unlinkSync(gitbookFaviconPath); | ||
// fs.createReadStream(faviconAbsolutePath).pipe(fs.createWriteStream(gitbookFaviconPath)); | ||
// } | ||
var number = this.options.pluginsConfig['icp'] && this.options.pluginsConfig['icp'].number; | ||
var indexPath = path.join(process.cwd(), '_book', 'index.html'); | ||
console.log("number="+number+",indexPath="+indexPath); | ||
// var appleTouchIconPrecomposed152PathFile = this.options.pluginsConfig['favicon-absolute'] && this.options.pluginsConfig['favicon-absolute'].appleTouchIconPrecomposed152; | ||
// if (appleTouchIconPrecomposed152PathFile.startsWith("/")) { | ||
// appleTouchIconPrecomposed152PathFile = appleTouchIconPrecomposed152PathFile.substring(1, appleTouchIconPrecomposed152PathFile.length); | ||
// if (number && fs.existsSync(indexPath)) { | ||
// fs.createReadStream(indexPath).pipe(fs.createWriteStream(indexPath)); | ||
// } | ||
// var appleTouchIconPrecomposed152 = path.join(process.cwd(), appleTouchIconPrecomposed152PathFile); | ||
// var gitbookAppleTouchPath = path.join(process.cwd(), '_book', 'gitbook', 'images', 'apple-touch-icon-precomposed-152.png'); | ||
// if (appleTouchIconPrecomposed152PathFile && fs.existsSync(appleTouchIconPrecomposed152PathFile) && fs.existsSync(gitbookAppleTouchPath)) { | ||
// fs.unlinkSync(gitbookAppleTouchPath); | ||
// fs.createReadStream(appleTouchIconPrecomposed152).pipe(fs.createWriteStream(gitbookAppleTouchPath)); | ||
// } | ||
} | ||
} | ||
}; |
{ | ||
"name": "gitbook-plugin-icp", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "gitbook plugin for adding icp info to footer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
430441
8
14