imdone-core 1.54.14 → 1.54.15

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.
@@ -2,7 +2,11 @@
2
2
  "permissions": {
3
3
  "allow": [
4
4
  "Bash(npm test:*)",
5
- "Bash(node test-debug.js:*)"
5
+ "Bash(node test-debug.js:*)",
6
+ "Bash(cat:*)",
7
+ "Bash(node test-ignore-patterns.js:*)",
8
+ "Bash(node test-ignore-patterns-detailed.js:*)",
9
+ "Bash(node test-ignore-patterns-fixed.js:*)"
6
10
  ]
7
11
  }
8
12
  }
@@ -85,11 +85,12 @@ function mixin(repo, fs = require('fs')) {
85
85
  })
86
86
  }
87
87
 
88
- repo.addFilePath = async function (path) {
88
+ repo.addFilePath = function (path) {
89
+ console.log('Adding file path to allFiles:', path)
89
90
  var relPath = repo.getRelativePath(path)
90
91
  var fullPath = repo.getFullPath(path)
91
92
 
92
- const stat = await fs.promises.lstat(fullPath)
93
+ const stat = fs.lstatSync(fullPath)
93
94
  if (stat.isDirectory()) relPath += _path.sep
94
95
  if (!repo.allFiles.includes(relPath)) {
95
96
  repo.allFiles.push(relPath)
@@ -152,12 +152,17 @@ function mixin(repo, fs = require('fs')) {
152
152
  if (_isImdonePause(file)) {
153
153
  return false
154
154
  }
155
-
156
- const ignore = !repo.shouldInclude(file)
157
- if (!ignore || /^.*\.(jpg|gif|pdf|png)$/i.test(file)) {
155
+ const isImage = /^.*\.(jpg|gif|pdf|png)$/i.test(file)
156
+ if (isImage) {
157
+ console.log('Excluding image file from watcher:', file)
158
+ return true
159
+ }
160
+ const include = repo.shouldInclude(file)
161
+ if (include) {
162
+ console.log('Including file in watcher:', file)
158
163
  repo.addFilePath(file)
159
164
  }
160
- return ignore
165
+ return !include
161
166
  },
162
167
  })
163
168
 
@@ -238,11 +243,11 @@ function mixin(repo, fs = require('fs')) {
238
243
  })
239
244
  })
240
245
  })
241
- .on('delete', function (path) {
246
+ .on('delete', async function (path) {
242
247
  log('Watcher received unlink event for file: ' + path)
243
248
  if (_isImdonePause(path)) {
244
249
  console.log('Pause file deleted. Resuming repository.')
245
- return repo.resume()
250
+ return await repo.resume()
246
251
  }
247
252
  if (paused) return log('Watcher is paused. Ignoring delete event for: ' + path)
248
253
  repo.removeFilePath(path)
package/lib/repository.js CHANGED
@@ -460,7 +460,7 @@ Repository.prototype.shouldInclude = function (relPath) {
460
460
  )
461
461
  }
462
462
  }
463
-
463
+ if (include) console.log('Including file:', relPath)
464
464
  return include
465
465
  }
466
466
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "1.54.14",
3
+ "version": "1.54.15",
4
4
  "description": "imdone-core",
5
5
  "main": "index.js",
6
6
  "bin": {