#!/usr/bin/env bash

# Outputs sha256 checksum of STDIN
# Works on Linux and MacOS

set -x
echo "$@" 1>&2

if test "$#" != 0; then
    echo "Usage: sha256sum < PATH" 1>&2
    exit 2
fi

case "$OSTYPE" in
    darwin*) exec shasum -a 256 "$@" ;;
    *) exec sha256sum "$@" ;;
esac
