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.
- package/package.json +1 -1
- package/src/index.js +6 -1
package/package.json
CHANGED
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)
|
|
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) {
|