Skip to content

Commit

Permalink
kek
Browse files Browse the repository at this point in the history
  • Loading branch information
meff34 committed Feb 2, 2019
1 parent 23ea565 commit 5a450f6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require("colors");

const logger = require("./logger.js");

const config = {
const defaultConfig = {
pathToStatic: "static",
mainMdFilename: "main.md",
removeTemp: true,
Expand All @@ -21,7 +21,7 @@ const config = {
// const { removeArtifacts, prepareEnv } = require("./utils.js")(config);
// const { read } = require("./markdown-analyze.js")(config);

const run = () => {
const run = (config) => {
const { pathToStatic, mainMdFilename, pathToPublic } = config;

const { render, afterRender } = require("./statics.js")(config);
Expand All @@ -44,8 +44,11 @@ const run = () => {
);
};

module.exports = () =>
run().catch(err => {
module.exports = (config) =>
run({
...defaultConfig,
...config,
}).catch(err => {
logger.err("run error", err);
removeArtifacts([path.resolve(pathToStatic), path.resolve(pathToPublic)]);
});

0 comments on commit 5a450f6

Please sign in to comment.