Created
June 30, 2018 07:24
-
-
Save Geri-Borbas/81b63632010450fe3f11b2d5cda0557d to your computer and use it in GitHub Desktop.
Sourcetree Custom Action for copy file 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 file 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 File URL | |
# Click to record shortcut: ⌥⇧F | |
# Script to run: /usr/local/bin/CopyFileUrl.sh | |
# Parameters: <REPOSITORY_URL> $REPO $FILE $SHA | |
# Example: https://bitbucket.org/eppz/Unity.Library.eppz $FILE $SHA | |
REPOSITORY_URL="$1" | |
FILE="$2" | |
SHA="$3" | |
FILE_URL="$REPOSITORY_URL/src/$SHA/$FILE" | |
echo "Copy '$FILE_URL' to clipboard." | |
echo "$FILE_URL" | /usr/bin/pbcopy | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment