mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-03-25 09:25:50 +00:00
fix: Add error handling verification to vt title command
- Add proper error checking after session.json update - Return appropriate exit codes on success/failure - Improve error messaging for better debugging
This commit is contained in:
parent
3fb5b463e8
commit
f6d529a1ab
1 changed files with 9 additions and 2 deletions
|
|
@ -30,8 +30,15 @@ with open('$SESSION_FILE.tmp', 'w') as f:
|
|||
ESCAPED_TITLE=$(printf '%s' "$TITLE" | sed 's/[[\.*^$()+?{|]/\\&/g' | sed 's/"/\\"/g')
|
||||
sed -i.bak "s|\"name\":[^,}]*|\"name\":\"$ESCAPED_TITLE\"|" "$SESSION_FILE" && rm "$SESSION_FILE.bak"
|
||||
fi
|
||||
echo "Session title updated to: $TITLE"
|
||||
exit 0
|
||||
|
||||
# Verify the update was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Session title updated to: $TITLE"
|
||||
exit 0
|
||||
else
|
||||
echo "Error: Failed to update session title" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Error: Session file not found at $SESSION_FILE" >&2
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue