@qaecy/cue-cli 0.0.12 → 0.0.13

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.
Files changed (2) hide show
  1. package/main.js +37 -7
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -113,7 +113,7 @@ var FIREBASE_CONFIG = (useEmulator = false) => ({
113
113
  useEmulator
114
114
  });
115
115
  var IGNORED_LOCAL = {
116
- dirs: ["node_modules", ".git", ".hg", ".svn", ".DS_Store"],
116
+ dirs: ["node_modules", ".git", ".hg", ".svn", ".DS_Store", ".Trash", ".Trashes", "$RECYCLE.BIN", "System Volume Information"],
117
117
  suffix: [".tmp", ".part", ".crdownload", ".zip", ".tar", ".gz"]
118
118
  };
119
119
 
@@ -3894,12 +3894,42 @@ async function listLocalFiles(dir, providerId = "", verbose = false, logInterval
3894
3894
  });
3895
3895
  }
3896
3896
  async function filesInLocalDirRecursive(dir, filterFunc = () => true, excludeDirs = true) {
3897
- const entries = await (0, import_promises.readdir)(dir, { withFileTypes: true, recursive: true });
3898
- return entries.filter((entry) => {
3899
- if (excludeDirs && !entry.isFile())
3900
- return false;
3901
- return filterFunc(entry);
3902
- }).map((entry) => (0, import_path2.join)(entry.parentPath, entry.name));
3897
+ const results = [];
3898
+ async function traverseDir(currentDir) {
3899
+ try {
3900
+ const entries = await (0, import_promises.readdir)(currentDir, { withFileTypes: true });
3901
+ for (const entry of entries) {
3902
+ const fullPath = (0, import_path2.join)(currentDir, entry.name);
3903
+ if (entry.isFile()) {
3904
+ if (filterFunc(entry)) {
3905
+ results.push(fullPath);
3906
+ }
3907
+ } else if (entry.isDirectory() && !excludeDirs) {
3908
+ if (filterFunc(entry)) {
3909
+ results.push(fullPath);
3910
+ }
3911
+ if (filterFunc(entry)) {
3912
+ await traverseDir(fullPath);
3913
+ }
3914
+ } else if (entry.isDirectory()) {
3915
+ if (filterFunc(entry)) {
3916
+ await traverseDir(fullPath);
3917
+ }
3918
+ }
3919
+ }
3920
+ } catch (error) {
3921
+ if (error instanceof Error && "code" in error) {
3922
+ const nodeError = error;
3923
+ if (nodeError.code === "EPERM" || nodeError.code === "EACCES") {
3924
+ console.warn(`Skipping directory due to permission error: ${currentDir}`);
3925
+ return;
3926
+ }
3927
+ }
3928
+ throw error;
3929
+ }
3930
+ }
3931
+ await traverseDir(dir);
3932
+ return results;
3903
3933
  }
3904
3934
  var DEFAULT_MAX_UNCOMPRESSED_SIZE = 500 * 1024 * 1024;
3905
3935
  var DEFAULT_MAX_RECURSION_DEPTH = 3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qaecy/cue-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Cue CLI for QAECY platform",
5
5
  "main": "main.js",
6
6
  "bin": {