[PR #14] [MERGED] fix: resolve exit code 1 in get-context.sh #42

Closed
opened 2026-03-03 15:47:28 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mindfold-ai/Trellis/pull/14
Author: @Yjh-Rking
Created: 1/31/2026
Status: Merged
Merged: 1/31/2026
Merged by: @taosu0216

Base: mainHead: fix/get-context-exit-code


📝 Commits (1)

  • 74d8381 fix: resolve exit code 1 in get-context.sh

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 .trellis/scripts/common/git-context.sh (+2 -2)

📄 Description

Problem

Running .trellis/scripts/get-context.sh returned exit code 1 even when executed successfully.

Actual error output:

● Bash(./trellis/scripts/get-context.sh)
  ⎿  Error: Exit code 1
     ========================================
     SESSION CONTEXT
     ========================================

     ## DEVELOPER
     Name: Rking

Root Cause

In bash, (( 0 )) returns exit code 1. The script uses set -e (exit on error), causing:

  • ((task_count++)) - returns exit code 1 when counter is 0
  • ((my_task_count++)) - same issue

Solution

Append || true to arithmetic expressions to ensure they always return exit code 0:

((task_count++)) || true
((my_task_count++)) || true

Files Changed

  • .trellis/scripts/common/git-context.sh (lines 185, 208)

Testing

  • Script now returns exit code 0 on successful execution

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mindfold-ai/Trellis/pull/14 **Author:** [@Yjh-Rking](https://github.com/Yjh-Rking) **Created:** 1/31/2026 **Status:** ✅ Merged **Merged:** 1/31/2026 **Merged by:** [@taosu0216](https://github.com/taosu0216) **Base:** `main` ← **Head:** `fix/get-context-exit-code` --- ### 📝 Commits (1) - [`74d8381`](https://github.com/mindfold-ai/Trellis/commit/74d8381830f08f4891cbc9eae5b10478e5830a13) fix: resolve exit code 1 in get-context.sh ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `.trellis/scripts/common/git-context.sh` (+2 -2) </details> ### 📄 Description ## Problem Running `.trellis/scripts/get-context.sh` returned exit code 1 even when executed successfully. **Actual error output:** ``` ● Bash(./trellis/scripts/get-context.sh) ⎿ Error: Exit code 1 ======================================== SESSION CONTEXT ======================================== ## DEVELOPER Name: Rking ``` ## Root Cause In bash, `(( 0 ))` returns exit code 1. The script uses `set -e` (exit on error), causing: - `((task_count++))` - returns exit code 1 when counter is 0 - `((my_task_count++))` - same issue ## Solution Append `|| true` to arithmetic expressions to ensure they always return exit code 0: ```bash ((task_count++)) || true ((my_task_count++)) || true ``` ## Files Changed - `.trellis/scripts/common/git-context.sh` (lines 185, 208) ## Testing - Script now returns exit code 0 on successful execution --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 15:47:28 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Trellis#42
No description provided.