Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checksums custom path #72

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const fsextra = require('fs-extra');
let docsifyTemplate = require('./docsify.template.js');
const markdownpdf = require('md-to-pdf').mdToPdf;
const http = require('http');
const Configstore = require('configstore');

const DIST_BACKUP_FOLDER_SUFFIX = '_bk';

Expand Down Expand Up @@ -767,13 +768,22 @@ const build = async (options, conf) => {
console.log(chalk.blue(`parsed ${tree.length} folders`));
if (options.GENERATE_LOCAL_IMAGES) {
console.log(chalk.blue('generating images'));
checkums_conf = conf
if (options.CHECKSUMS_FILE !== undefined) {
// console.log(options.CHECKSUMS_FILE)
checkums_conf = new Configstore(
process.cwd().split(path.sep).splice(1).join('_'),
{},
{ configPath: path.join(process.cwd(), options.CHECKSUMS_FILE) }
);
}
await generateImages(
tree,
options,
(count, total) => {
process.stdout.write(`processed ${count}/${total} images\r`);
},
conf
checkums_conf
);
console.log('');
}
Expand Down
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const getOptions = (conf) => {
GENERATE_COMPLETE_MD_FILE: conf.get('generateCompleteMD'),
GENERATE_COMPLETE_PDF_FILE: conf.get('generateCompletePDF'),
GENERATE_LOCAL_IMAGES: conf.get('generateLocalImages'),
CHECKSUMS_FILE: conf.get('checksumsFile'),
EMBED_DIAGRAM: conf.get('embedDiagram'),
ROOT_FOLDER: conf.get('rootFolder'),
DIST_FOLDER: conf.get('distFolder'),
Expand Down