Skip to content

Instantly share code, notes, and snippets.

@weavenet
Last active August 11, 2017 14:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weavenet/af002bde11adc8fb7b31 to your computer and use it in GitHub Desktop.
Save weavenet/af002bde11adc8fb7b31 to your computer and use it in GitHub Desktop.
Wrapper script to execute trello CLI with arguments read from a dot file
#!/bin/bash
#
# Wrapper script for trello cli that appends default arguments as well as reads
# additional arguments from a file if it exists in the cwd. It is assumed
# the file contains a text string of arguments to append to the command.
#
# See https://github.com/brettweavnet/trello_cli/issues/22 for more details
#
# For example, the file .trellocli existing in a directory with the content:
#
# -b 12345
#
# When ran with the following args:
#
# trello.sh board list
#
# It will execute:
#
# trello board list -o json -b 12345
cmdArgs=$@
commonArgs="-o json"
if [ -e ".trellocli" ]; then
fileArgs=`cat .trellocli`
fi
trello $cmdArgs $commonArgs $fileArgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment