8888
8989# Include project context if requested
9090if [ " $PROJECT_CONTEXT " = true ]; then
91- local project_name=$( get_project_name)
92- local project_description=" "
91+ project_name=$( get_project_name)
92+ project_description=" "
9393
9494 # Try to find project description
9595 if [ -f " package.json" ]; then
133133
134134# Show branch information if requested
135135if [ " $BRANCH_INFO " = true ]; then
136- local current_branch=$( git branch --show-current)
137- local upstream=$( git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null || echo " None" )
138- local tracking_status=$( git status -sb | head -n 1)
136+ current_branch=$( git branch --show-current)
137+ upstream=$( git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null || echo " None" )
138+ tracking_status=$( git status -sb | head -n 1)
139139
140140 case $FORMAT in
141141 md)
177177
178178# Show git diff if requested
179179if [ " $SHOW_DIFF " = true ]; then
180- local diff_cmd=" git diff"
181- local diff_title=" Current Changes (Diff)"
180+ diff_cmd=" git diff"
181+ diff_title=" Current Changes (Diff)"
182182
183183 if [ " $STAGED_ONLY " = true ]; then
184184 diff_cmd=" git diff --staged"
@@ -199,7 +199,7 @@ if [ "$SHOW_DIFF" = true ]; then
199199 fi
200200
201201 # Get the diff
202- local diff_output=$( eval $diff_cmd )
202+ diff_output=$( eval $diff_cmd )
203203
204204 if [ -n " $diff_output " ]; then
205205 case $FORMAT in
@@ -215,7 +215,7 @@ if [ "$SHOW_DIFF" = true ]; then
215215 echo " \" diff\" : {"
216216 echo " \" title\" : \" $diff_title \" ,"
217217 # Escape special characters for JSON
218- local diff_json=$( echo " $diff_output " | sed ' s/"/\\"/g' | sed ' :a;N;$!ba;s/\n/\\n/g' )
218+ diff_json=$( echo " $diff_output " | sed ' s/"/\\"/g' | sed ' :a;N;$!ba;s/\n/\\n/g' )
219219 echo " \" content\" : \" $diff_json \" "
220220 echo " },"
221221 ;;
@@ -232,7 +232,7 @@ if [ "$SHOW_DIFF" = true ]; then
232232fi
233233
234234# Show summary of files changed
235- local files_changed=$( git diff --name-status)
235+ files_changed=$( git diff --name-status)
236236if [ " $STAGED_ONLY " = true ]; then
237237 files_changed=$( git diff --staged --name-status)
238238fi
390390# Include commit message guidance if requested
391391if [ " $INCLUDE_PROMPT " = true ]; then
392392 # Get the prompt content from the file or use a default
393- local prompt_content=" "
393+ prompt_content=" "
394394 if [ -f " prompts/commit_prompt.txt" ]; then
395395 prompt_content=$( cat " prompts/commit_prompt.txt" )
396396 else
@@ -412,7 +412,7 @@ if [ "$INCLUDE_PROMPT" = true ]; then
412412 echo " ,"
413413 echo " \" commit_guidance\" : {"
414414 # Escape special characters for JSON
415- local guidance_json=$( echo " $prompt_content " | sed ' s/"/\\"/g' | sed ' s/\\n/\\\\n/g' )
415+ guidance_json=$( echo " $prompt_content " | sed ' s/"/\\"/g' | sed ' s/\\n/\\\\n/g' )
416416 echo " \" content\" : \" $guidance_json \" "
417417 if [ " $CONVENTIONAL " = true ]; then
418418 echo " \" conventional\" : true"
@@ -433,4 +433,4 @@ if [ "$FORMAT" = "json" ]; then
433433 echo " }"
434434fi
435435
436- exit 0
436+ exit 0
0 commit comments