Skip to content

Instantly share code, notes, and snippets.

@Geri-Borbas
Created June 30, 2018 07:24
Show Gist options
  • Save Geri-Borbas/81b63632010450fe3f11b2d5cda0557d to your computer and use it in GitHub Desktop.
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.
#!/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