Created
June 30, 2018 07:23
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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