Skip to content

Instantly share code, notes, and snippets.

@Geri-Borbas
Created June 30, 2018 07:23
Show Gist options
  • Save Geri-Borbas/77069947f6b1df01102cfb99a6f4d604 to your computer and use it in GitHub Desktop.
Save Geri-Borbas/77069947f6b1df01102cfb99a6f4d604 to your computer and use it in GitHub Desktop.
Sourcetree Custom Action for copy commit URL to clipboard. Perfect for use in concert with Bitbucket Cloud App for Slack.
#!/bin/sh
# eppz!tools
# Sourcetree Custom Action for copy commit URL to clipboard.
# Perfect for use in concert with Bitbucket Cloud App for Slack.
#
# 1. Copy this script to '/usr/local/bin'.
# 2. Setup a Custom Action in Sourcetree according details below.
#
# Menu Caption: Copy Commit URL
# Click to record shortcut: ⌥⇧C
# Script to run: /usr/local/bin/CopyCommitUrl.sh
# Parameters: <REPOSITORY_URL> $REPO $FILE $SHA
# Example: https://bitbucket.org/eppz/Unity.Library.eppz $FILE $SHA
REPOSITORY_URL="$1"
FILE="$2"
SHA="$3"
COMMIT_URL="$REPOSITORY_URL/src/$SHA"
echo "Copy '$COMMIT_URL' to clipboard."
echo "$COMMIT_URL" | /usr/bin/pbcopy
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment