Skip to content

Commit f4d3eed

Browse files
committed
fix: options for procees from config, close #306
1 parent a0e093a commit f4d3eed

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/cli.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ const cli = meow(`
5353
alias: 'u',
5454
isMultiple: true
5555
},
56+
// https://github.com/sindresorhus/meow/issues/158
57+
// options: {
58+
// type: 'string',
59+
// isMultiple: true
60+
// },
5661
root: {
5762
type: 'string',
5863
alias: 'r',
@@ -65,13 +70,15 @@ const cli = meow(`
6570
}
6671
});
6772

68-
const read = file => new Promise(resolve => fs.readFile(file, 'utf8', (error, data) => {
69-
if (error) {
70-
console.warn(error);
71-
}
73+
const read = file => new Promise(resolve => {
74+
fs.readFile(file, 'utf8', (error, data) => {
75+
if (error) {
76+
console.warn(error);
77+
}
7278

73-
resolve(data);
74-
}));
79+
resolve(data);
80+
});
81+
});
7582

7683
const interopRequire = object => object && object.__esModule ? object.default : object;
7784

@@ -86,7 +93,7 @@ const processing = async file => {
8693

8794
makeDir(path.dirname(output))
8895
.then(read.bind(undefined, file))
89-
.then(html => posthtml(plugins).process(html))
96+
.then(html => Promise.resolve(posthtml(plugins).process(html, config.options)))
9097
.then(({html}) => {
9198
fs.writeFile(output, html, error => {
9299
if (error) {

0 commit comments

Comments
 (0)