unixorn/tumult.plugin.zsh

View on GitHub
bin/clip

Summary

Maintainability
Test Coverage
#!/bin/bash
#
# clipboard helper

if [[ "$(uname -s)" != 'Darwin' ]]; then
  echo 'Sorry, this script only works on macOS'
  exit 1
fi

# shellcheck disable=SC2071
if [[ $# > 0 ]]; then
  echo -n "$@" | pbcopy
else
  pbcopy < /dev/stdin
fi