From b4e0f77ae9ce39bf3bdf141cb74df7467f86b00a Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Mon, 12 Sep 2022 17:56:57 -0400 Subject: [PATCH] acme: Add :Gbrowse clone to open file as URL for sharing --- bin/acme-scripts/Gbrowse | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/acme-scripts/Gbrowse diff --git a/bin/acme-scripts/Gbrowse b/bin/acme-scripts/Gbrowse new file mode 100755 index 0000000..dc6c4f3 --- /dev/null +++ b/bin/acme-scripts/Gbrowse @@ -0,0 +1,8 @@ +#!/bin/sh +set -e +REPO=$(git rev-parse --show-toplevel) +[ -z "$REPO" ] && exit 1 +FILE=${1:-$(readlink -f $samfile)} +resource=${FILE##$REPO/} +url=$(git remote get-url origin | sed -e 's/^git@//' -e 's@:@/@' -e 's/\.git$//') +${BROWSER:-firefox} "https://$url/blob/master/$resource" -- libgit2 1.1.1