fix: detect piped stdin properly in snippet create

Summary

Fixes the hasStdIn() function in snippet create command which was incorrectly checking fi.Size() > 0 to detect piped input. For pipes, Size() is always 0 even when data is being piped through, causing the command to reject valid piped input.

Changes

  • Changed stdin detection from checking file size to checking file mode
  • Now correctly detects pipes and redirected files by checking if stdin is NOT a character device (ModeCharDevice)

Testing

  • All existing tests pass
  • Manually verified: echo "package main" | glab snippet new --title "test" --filename "main.go" now works correctly

Closes #8173 (closed)

Merge request reports

Loading