Skip to content

Instantly share code, notes, and snippets.

@derickfay
Created June 16, 2015 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derickfay/af09e40d558d7b0daa69 to your computer and use it in GitHub Desktop.
Save derickfay/af09e40d558d7b0daa69 to your computer and use it in GitHub Desktop.
# !/bin/sh
#
# adds @XXX Taskpaper style tags to a single file as Finder tags,
# converting hyphens to spaces in the process
#
# requires https://github.com/jdberry/tag
#
TAGS=$(grep "@[a-zA-Z\-]*" --only-matching "$1" | sort | uniq | sed 's/@//g;s/-/ /g' | tr '\n' ', ')
tag -a "$TAGS" "$1"
@derickfay
Copy link
Author

to do: refine grep to exclude email addresses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment