ccperm 1.2.0 → 1.2.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/dist/cli.js +11 -1
- package/dist/scanner.js +14 -20
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -64,7 +64,17 @@ async function main() {
|
|
|
64
64
|
console.log(`\n ${colors_js_1.CYAN}${colors_js_1.BOLD}ccperm${colors_js_1.NC} ${colors_js_1.DIM}v${(0, updater_js_1.getVersion)()}${colors_js_1.NC} — Claude Code Permission Audit\n`);
|
|
65
65
|
const searchDir = isCwd ? process.cwd() : node_os_1.default.homedir();
|
|
66
66
|
console.log(` Scope: ${colors_js_1.YELLOW}${isCwd ? searchDir : '~ (all projects)'}${colors_js_1.NC}`);
|
|
67
|
-
const
|
|
67
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
68
|
+
let frame = 0;
|
|
69
|
+
const isTTY = process.stdout.isTTY;
|
|
70
|
+
const spinner = isTTY ? setInterval(() => {
|
|
71
|
+
process.stdout.write(`\r ${colors_js_1.CYAN}${frames[frame++ % frames.length]}${colors_js_1.NC} Scanning...`);
|
|
72
|
+
}, 80) : null;
|
|
73
|
+
const files = await (0, scanner_js_1.findSettingsFiles)(searchDir);
|
|
74
|
+
if (spinner) {
|
|
75
|
+
clearInterval(spinner);
|
|
76
|
+
process.stdout.write('\r\x1b[K');
|
|
77
|
+
}
|
|
68
78
|
if (files.length === 0) {
|
|
69
79
|
console.log(` ${colors_js_1.GREEN}✔ No settings files found.${colors_js_1.NC}\n`);
|
|
70
80
|
return;
|
package/dist/scanner.js
CHANGED
|
@@ -17,30 +17,24 @@ function findSettingsFiles(searchDir) {
|
|
|
17
17
|
'snap', '.vscode', '.docker', '.cargo', '.rustup', 'go', '.gradle', '.m2',
|
|
18
18
|
'Library', '.Trash', 'Pictures', 'Music', 'Videos', 'Downloads'];
|
|
19
19
|
const pruneArgs = prune.flatMap((d) => ['-name', d, '-o']).slice(0, -1);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const out = (0, node_child_process_1.execFileSync)('find', [
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
(0, node_child_process_1.execFile)('find', [
|
|
23
22
|
searchDir,
|
|
24
23
|
'(', ...pruneArgs, ')', '-prune',
|
|
25
24
|
'-o', '-path', '*/.claude/settings*.json', '-type', 'f', '-print',
|
|
26
|
-
], {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
], { encoding: 'utf8', timeout: 15000 }, (err, stdout) => {
|
|
26
|
+
const out = (stdout || err?.stdout || '').trim();
|
|
27
|
+
const lines = out ? out.split('\n').filter(Boolean) : [];
|
|
28
|
+
resolve(lines.filter((f) => {
|
|
29
|
+
try {
|
|
30
|
+
node_fs_1.default.accessSync(f, node_fs_1.default.constants.W_OK);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}));
|
|
30
37
|
});
|
|
31
|
-
lines = out.trim().split('\n').filter(Boolean);
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
lines = (e.stdout || '').trim().split('\n').filter(Boolean);
|
|
35
|
-
}
|
|
36
|
-
return lines.filter((f) => {
|
|
37
|
-
try {
|
|
38
|
-
node_fs_1.default.accessSync(f, node_fs_1.default.constants.W_OK);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
38
|
});
|
|
45
39
|
}
|
|
46
40
|
function scanFile(filePath) {
|