@@ -69,8 +69,12 @@ This is a new feature that adds functionality to the application.
6969It includes several improvements and bug fixes.` ;
7070 writeFileSync ( messageFile , commitMessage , 'utf8' ) ;
7171
72- // Set environment variable to trigger CoDevelopedBy
73- const env = { ...process . env , CLAUDECODE : '1' } ;
72+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
73+ const env = {
74+ ...process . env ,
75+ CLAUDECODE : '1' ,
76+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
77+ } ;
7478
7579 // Execute the commit-msg hook directly
7680 const execResult = spawnSync (
@@ -112,8 +116,12 @@ It includes several improvements and bug fixes.`;
112116This is a merge commit message.` ;
113117 writeFileSync ( messageFile , mergeCommitMessage , 'utf8' ) ;
114118
115- // Set environment variable to trigger CoDevelopedBy
116- const env = { ...process . env , CLAUDECODE : '1' } ;
119+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
120+ const env = {
121+ ...process . env ,
122+ CLAUDECODE : '1' ,
123+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
124+ } ;
117125
118126 // Execute the commit-msg hook directly
119127 const execResult = spawnSync (
@@ -139,8 +147,12 @@ This is a merge commit message.`;
139147This is a fixup commit.` ;
140148 writeFileSync ( messageFile , fixupCommitMessage , 'utf8' ) ;
141149
142- // Set environment variable to trigger CoDevelopedBy
143- const env = { ...process . env , CLAUDECODE : '1' } ;
150+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
151+ const env = {
152+ ...process . env ,
153+ CLAUDECODE : '1' ,
154+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
155+ } ;
144156
145157 // Execute the commit-msg hook directly
146158 const execResult = spawnSync (
@@ -172,8 +184,12 @@ This updates an existing feature.
172184Change-Id: ${ existingChangeId } ` ;
173185 writeFileSync ( messageFile , commitMessage , 'utf8' ) ;
174186
175- // Set environment variable to trigger CoDevelopedBy
176- const env = { ...process . env , CLAUDECODE : '1' } ;
187+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
188+ const env = {
189+ ...process . env ,
190+ CLAUDECODE : '1' ,
191+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
192+ } ;
177193
178194 // Execute the commit-msg hook directly
179195 const execResult = spawnSync (
@@ -213,8 +229,13 @@ Change-Id: ${existingChangeId}`;
213229This is a really awesome feature.` ;
214230 writeFileSync ( messageFile , commitMessage , 'utf8' ) ;
215231
216- // Test with GEMINI_CLI environment variable, but first unset CLAUDECODE
217- const env = { ...process . env , CLAUDECODE : undefined , GEMINI_CLI : '1' } ;
232+ // Test with GEMINI_CLI environment variable, but first unset CLAUDECODE and ensure PATH includes dist/bin
233+ const env = {
234+ ...process . env ,
235+ CLAUDECODE : undefined ,
236+ GEMINI_CLI : '1' ,
237+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
238+ } ;
218239
219240 // Execute the commit-msg hook directly
220241 const execResult = spawnSync (
@@ -436,8 +457,12 @@ This adds support for the new commit-msg.changeid configuration.`;
436457 // Set up git configuration to disable Change-Id using the new config option
437458 execSync ( 'git config commit-msg.changeid false' , { stdio : 'ignore' } ) ;
438459
439- // Set environment variable to trigger CoDevelopedBy
440- const env = { ...process . env , CLAUDECODE : '1' } ;
460+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
461+ const env = {
462+ ...process . env ,
463+ CLAUDECODE : '1' ,
464+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
465+ } ;
441466
442467 // Execute the commit-msg hook directly
443468 const execResult = spawnSync (
@@ -484,8 +509,12 @@ This adds support for the new commitmsg.changeid configuration.`;
484509 // Set up git configuration to disable Change-Id using the new config option
485510 execSync ( 'git config commitmsg.changeid false' , { stdio : 'ignore' } ) ;
486511
487- // Set environment variable to trigger CoDevelopedBy
488- const env = { ...process . env , CLAUDECODE : '1' } ;
512+ // Set environment variable to trigger CoDevelopedBy and ensure PATH includes dist/bin
513+ const env = {
514+ ...process . env ,
515+ CLAUDECODE : '1' ,
516+ PATH : `${ path . join ( originalCwd , 'dist' , 'bin' ) } :${ process . env . PATH || '' } ` ,
517+ } ;
489518
490519 // Execute the commit-msg hook directly
491520 const execResult = spawnSync (
0 commit comments