@tmsfe/tmskit 0.0.15-beta.5 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils/io.js CHANGED
@@ -97,6 +97,25 @@ const fileInDir = (dir, file) => {
97
97
  };
98
98
 
99
99
 
100
+ function findAllFilesOfDir(dir) {
101
+ const list = [];
102
+ function listFile(dir) {
103
+ const arr = fs.readdirSync(dir);
104
+ arr.forEach((item) => {
105
+ const fullPath = path.join(dir, item);
106
+ const stats = fs.statSync(fullPath);
107
+ if (stats.isDirectory()) {
108
+ listFile(fullPath);
109
+ } else {
110
+ list.push(fullPath);
111
+ }
112
+ });
113
+ return list;
114
+ }
115
+ listFile(dir);
116
+ return list;
117
+ }
118
+
100
119
  module.exports = {
101
120
  isDirEmpty,
102
121
  copyFile,
@@ -105,4 +124,5 @@ module.exports = {
105
124
  ext,
106
125
  fileInDir,
107
126
  isFile,
127
+ findAllFilesOfDir,
108
128
  };
@@ -1,15 +0,0 @@
1
- const fs = require('fs');
2
- const shellJs = require('shelljs');
3
-
4
- function main() {
5
- const pwd = shellJs.pwd();
6
- const gulpWatchDirNM = `${pwd}/node_modules/gulp-watch/node_modules`;
7
- if (fs.existsSync(gulpWatchDirNM)) {
8
- shellJs.cd(gulpWatchDirNM);
9
- console.log('pwd pwd pwd', shellJs.pwd());
10
- shellJs.rm('-rf', 'chokidar');
11
- }
12
- }
13
-
14
- main();
15
-