forged-cli 0.4.1 → 0.4.2
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/commands/scan.js +7 -0
package/package.json
CHANGED
package/src/commands/scan.js
CHANGED
|
@@ -122,6 +122,13 @@ export async function scanCommand(cwd = process.cwd(), opts = {}) {
|
|
|
122
122
|
|
|
123
123
|
// 1. Parse package.json
|
|
124
124
|
const { deps, scripts, error, name: pkgName, version: pkgVersion } = checkPackageJson(cwd);
|
|
125
|
+
|
|
126
|
+
// Not a Node project: nothing to scan. Return before writing the scan
|
|
127
|
+
// cache, so the dotfiles badge keeps the last real result.
|
|
128
|
+
if (!existsSync(join(cwd, 'package.json'))) {
|
|
129
|
+
console.log(`${yellow}ℹ No package.json here — not a Node project, nothing to scan.${reset}\n`);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
125
132
|
if (error) findings.errors.push({ message: error });
|
|
126
133
|
|
|
127
134
|
// 2. Dangerous scripts
|