image-guard 5.3.0 → 5.3.1

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/package.json +1 -1
  2. package/src/index.js +6 -1
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "test": "node --test bin/image-guard.test.js"
55
55
  },
56
56
  "type": "module",
57
- "version": "5.3.0"
57
+ "version": "5.3.1"
58
58
  }
package/src/index.js CHANGED
@@ -36,10 +36,15 @@ export async function runImageGuard() {
36
36
  throw new Error('`--staged` takes its files from Git, not from a path—pass one or the other.')
37
37
  }
38
38
 
39
- if (!fsSync.existsSync(dir) || !fsSync.statSync(dir).isDirectory()) {
39
+ if (!fsSync.existsSync(dir)) {
40
40
  throw new Error(`No such directory: ${dir}`)
41
41
  }
42
42
 
43
+ // A path that is there but isn’t a directory gets its own message
44
+ if (!fsSync.statSync(dir).isDirectory()) {
45
+ throw new Error(`Not a directory: ${dir}`)
46
+ }
47
+
43
48
  // Share status
44
49
  const summary = (run, includesConversion = false) => {
45
50
  if (run) {