Skip to content

Instantly share code, notes, and snippets.

@davidmfoley
Created December 22, 2017 18:44
Show Gist options
  • Save davidmfoley/49bd76788124b866cbe8d850ed36d85c to your computer and use it in GitHub Desktop.
Save davidmfoley/49bd76788124b866cbe8d850ed36d85c to your computer and use it in GitHub Desktop.
Run flow (flowtype) check, errors sent to stderr, exit non-zero on failure
#! /bin/bash
# flow check prints all of its output to stdout.
# In CI, we want to print only failures to stderr to make them easier to find in the build log.
# ignore flow diag messages, get rid of 'success' message', then redirect to stderr
# grep -v exits non-zero on match match, so we flip the exit code
! flow check 2>/dev/null | grep -v 'Found 0 errors' 1>&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment