Skip to content

Instantly share code, notes, and snippets.

@ohadlevy
Last active December 25, 2015 00:58
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 ohadlevy/6891157 to your computer and use it in GitHub Desktop.
Save ohadlevy/6891157 to your computer and use it in GitHub Desktop.
#!/bin/bash
ID=$1
EDITOR='vim'
if [ -z "$ID" ]; then
echo "Must define ID, listing templates instead"
hammer template list
echo "please execute $0 <ID>"
exit 1
fi
TFILE="/tmp/foreman-$(basename $0).$$.eruby"
hammer template dump --id $ID > $TFILE
$EDITOR $TFILE
echo "if you want to upload your changes then execute:"
echo "hammer template update --file $TFILE --id $ID --audit-comment <change info>"
@lzap
Copy link

lzap commented Oct 9, 2013

Hmmmm why dont we edit that right away - hammer could open up the $EDITOR...

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