diff --git a/plugin/hooks/hooks.json b/plugin/hooks/hooks.json index 6f044d9b5..4756825f0 100644 --- a/plugin/hooks/hooks.json +++ b/plugin/hooks/hooks.json @@ -3,11 +3,12 @@ "hooks": { "Setup": [ { + "_comment": "Uses smart-install.js (not setup.sh which was deleted in 74d94aa2). See #1268.", "matcher": "*", "hooks": [ { "type": "command", - "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; \"$_R/scripts/setup.sh\"", + "command": "_R=\"${CLAUDE_PLUGIN_ROOT}\"; [ -z \"$_R\" ] && _R=\"$HOME/.claude/plugins/marketplaces/thedotmack/plugin\"; node \"$_R/scripts/smart-install.js\"", "timeout": 300 } ] diff --git a/tests/smart-install.test.ts b/tests/smart-install.test.ts index 7c3f5f6d4..68d7d4b19 100644 --- a/tests/smart-install.test.ts +++ b/tests/smart-install.test.ts @@ -163,3 +163,41 @@ describe('smart-install verifyCriticalModules logic', () => { expect(missing).toEqual(['@chroma-core/other-pkg']); }); }); + +describe('hooks.json Setup hook (#1268)', () => { + const hooksJsonPath = join(__dirname, '..', 'plugin', 'hooks', 'hooks.json'); + + it('should reference an existing script in the Setup hook', () => { + const hooksJson = JSON.parse(readFileSync(hooksJsonPath, 'utf-8')); + const setupHooks = hooksJson.hooks?.Setup; + expect(setupHooks).toBeDefined(); + expect(setupHooks.length).toBeGreaterThan(0); + + const setupCommand: string = setupHooks[0].hooks[0].command; + + // Extract the script path from the hook command. + // Format: _R="..."; [ -z "$_R" ] && _R="..."; node "$_R/scripts/