Skip to content

fix(snippet create): allow for stdin

Jay McCure requested to merge jmc-snippet-stdin into main

Description

Previous discussion for context: !1614 (comment 2040182399)

Previously the cli would hang if stdin was not passed into glab snippet create when a path was not passed in. This was fixed in !1580 (merged), but had the adverse side affect of no stdin being able to be passed in at all.

Now with this MR we can pass stdin and also get an error when stdin is required, rather than hanging.

Some small changes to the tests to match the API

How has this been tested?

Screenshots (if appropriate):

scenario screenshot
no path / no stdin Screenshot_2024-08-16_at_13.42.40
stdin / no path Screenshot_2024-08-16_at_13.43.16
path / no stdin Screenshot_2024-08-16_at_13.43.24
invalid path / no stdin Screenshot_2024-08-16_at_13.48.59
no path / no stdin / no filename Screenshot_2024-08-16_at_13.50.25

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Jay McCure

Merge request reports