mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-21 00:58:07 +02:00
fix(hooks): keep silent hook paths silent (#2987)
* fix(hooks): keep silent hook paths silent * fix(hooks): harden stream failure handling * fix(hooks): settle interrupted input streams * test(hooks): name stream input limits * test(hooks): isolate PostToolUse dispatcher fixtures
This commit is contained in:
@@ -11,7 +11,9 @@ const path = require('path');
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
const SCRIPT = path.join(__dirname, '..', '..', 'scripts', 'hooks', 'plugin-hook-bootstrap.js');
|
||||
const LIFECYCLE_SCRIPT = path.join(__dirname, '..', '..', 'scripts', 'hooks', 'lifecycle-hook-bootstrap.js');
|
||||
const { normalizePluginRootForPlatform, withComparisonInput } = require(SCRIPT);
|
||||
const { resolveTimeout } = require(LIFECYCLE_SCRIPT);
|
||||
|
||||
function createTempDir() {
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'plugin-hook-bootstrap-'));
|
||||
@@ -126,6 +128,16 @@ function runTests() {
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('lifecycle bootstrap shares Windows root normalization and bounds timeouts', () => {
|
||||
const rootResolver = require(path.join(__dirname, '..', '..', 'scripts', 'lib', 'resolve-ecc-root.js'));
|
||||
assert.strictEqual(
|
||||
rootResolver.normalizePluginRootForPlatform('/c/Users/x/.claude/plugins/ecc', 'win32'),
|
||||
'C:/Users/x/.claude/plugins/ecc'
|
||||
);
|
||||
assert.strictEqual(resolveTimeout('600000'), 300000);
|
||||
assert.strictEqual(resolveTimeout('invalid'), 30000);
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('node mode runs target script with plugin root environment', () => {
|
||||
const root = createTempDir();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user