Skip to content

Commit 6c5e306

Browse files
committed
fix: suport for sources
1 parent 04bcd6a commit 6c5e306

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,22 @@ if (extract) {
9393
/**
9494
* Store html files by config sources
9595
**/
96-
// if (sources) {
97-
// sources.forEach(async ({entry, collection, document_id, key, data}) => {
98-
// if (!path) return;
96+
if (sources) {
97+
sources.forEach(async ({entry, collection, document_id, key, data}) => {
98+
if (!path) return;
9999

100-
// let content = fs.readFileSync(path, 'utf8');
100+
let content = fs.readFileSync(path, 'utf8');
101101

102-
// if (content && key && collection) {
103-
// if (!data) data = {};
104-
// let storeData = {
105-
// [key]: content,
106-
// ...data
107-
// };
108-
// await runStore({collection, document_id, data: storeData}, 'sources');
109-
// }
110-
// })
111-
// }
102+
if (content && key && collection) {
103+
if (!data) data = {};
104+
let storeData = {
105+
[key]: content,
106+
...data
107+
};
108+
await runStore({collection, document_id, data: storeData}, 'sources');
109+
}
110+
})
111+
}
112112

113113
console.log('end....')
114114

0 commit comments

Comments
 (0)