safelaunch 1.0.21 → 1.0.22

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safelaunch",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Validate your environment before every push. Catch missing, empty, and misconfigured env variables before they break production.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -99,11 +99,12 @@ function detectProjectType(cwd) {
99
99
  }
100
100
 
101
101
  function scanFiles(dir, extensions, pattern, found = new Set()) {
102
- const items = fs.readdirSync(dir);
102
+ let items;
103
+ try { items = fs.readdirSync(dir); } catch (_) { return found; }
103
104
  for (const item of items) {
104
105
  if (item === 'node_modules' || item === '.git') continue;
105
106
  const full = path.join(dir, item);
106
- const stat = fs.statSync(full);
107
+ let stat; try { stat = fs.statSync(full); } catch (_) { continue; }
107
108
  if (stat.isDirectory()) {
108
109
  scanFiles(full, extensions, pattern, found);
109
110
  } else if (extensions.some(ext => item.endsWith(ext))) {
@@ -195,11 +196,12 @@ function checkHardcodedSecrets(cwd) {
195
196
  const hits = [];
196
197
  function walk(dir) {
197
198
  try {
198
- const items = fs.readdirSync(dir);
199
+ let items;
200
+ try { items = fs.readdirSync(dir); } catch (_) { return found; }
199
201
  for (const item of items) {
200
202
  if (item === 'node_modules' || item === '.git') continue;
201
203
  const full = path.join(dir, item);
202
- const stat = fs.statSync(full);
204
+ let stat; try { stat = fs.statSync(full); } catch (_) { continue; }
203
205
  if (stat.isDirectory()) {
204
206
  walk(full);
205
207
  } else if (extensions.some(ext => item.endsWith(ext))) {