Skip to content

Commit

Permalink
refactor: (strf-8740) move recursiveReadDir to fsUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGenash committed Oct 12, 2020
1 parent 7f58d48 commit f2e2724
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/stencil-bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const upath = require('upath');
const Readdir = require('recursive-readdir');
const Archiver = require('archiver');
const async = require('async');
const crypto = require('crypto');
Expand All @@ -12,6 +11,7 @@ const Cycles = require('./Cycles');
const cssAssembler = require('./css-assembler');
const langAssembler = require('./lang-assembler');
const templateAssembler = require('./template-assembler');
const { recursiveReadDir } = require('./utils/fsUtils');
const { fetchRegions } = require('./regions');

const MEGABYTE = 1024 * 1024;
Expand Down Expand Up @@ -149,7 +149,7 @@ class Bundle {
assembleTemplatesTask(callback) {
console.log('Template Parsing Started...');

Readdir(this.templatesPath, ['!*.html'], (readdirError, files) => {
recursiveReadDir(this.templatesPath, ['!*.html'], (readdirError, files) => {
if (readdirError) {
return callback(readdirError);
}
Expand Down Expand Up @@ -228,7 +228,7 @@ class Bundle {
generateManifest(taskResults, callback) {
console.log('Generating Manifest Started...');

Readdir(this.templatesPath, ['!*.html'], (err, filePaths) => {
recursiveReadDir(this.templatesPath, ['!*.html'], (err, filePaths) => {
if (err) {
return callback(err);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/fsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

const fs = require('fs');
const recursiveReadDir = require('recursive-readdir');
const jsonLint = require('../json-lint');

/**
Expand All @@ -17,4 +18,5 @@ async function parseJsonFile(filePath) {

module.exports = {
parseJsonFile,
recursiveReadDir,
};

0 comments on commit f2e2724

Please sign in to comment.