aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/pastebin (renamed from scripts/pastebin.sh)10
-rw-r--r--sh/fzf.sh9
2 files changed, 11 insertions, 8 deletions
diff --git a/scripts/pastebin.sh b/scripts/pastebin
index d306f87..319b126 100755
--- a/scripts/pastebin.sh
+++ b/scripts/pastebin
@@ -6,7 +6,7 @@ usage() {
Missing argument <$1>.
Usage:
- pastebin.sh <FULL_TITLE> [-|FILE]
+ $0 <FULL_TITLE> [-|FILE]
Reads contents from [FILE], from stdin if '-' is given, and opens the
editor on the content.
@@ -15,9 +15,9 @@ Usage:
FULL_TITLE Full title of the pastebin
Examples:
- pastebin.sh 'My example pastebin title'
- pastebin.sh 'My example pastebin title' - < file
- cat file | pastebin.sh 'My example pastebin title' -
+ pastebin 'My example pastebin title'
+ pastebin 'My example pastebin title' - < file
+ cat file | pastebin 'My example pastebin title' -
EOF
}
@@ -79,6 +79,6 @@ EOF
git reset .
git add "$OUT"
git commit -m "$0: Auto-add $OUT"
-make publish
+make clean publish
open "https://euandre.org/pastebin/$(echo "$PASTE_DATE" | tr '-' '/')/$SLUG_TITLE.html"
cd - > /dev/null
diff --git a/sh/fzf.sh b/sh/fzf.sh
index 4c26eb2..5b693c1 100644
--- a/sh/fzf.sh
+++ b/sh/fzf.sh
@@ -67,8 +67,11 @@ v() {
fi
}
-cm() {
+cn() {
CHOICE="$(git log --oneline | fzf)"
- INDEX="$(git log --oneline | grep -nF "$CHOICE" | cut -d: -f1)"
- git rev-parse "HEAD~$INDEX"
+ git log --oneline | grep -nF "$CHOICE" | cut -d: -f1
+}
+
+cm() {
+ git rev-parse "HEAD~$(cn)"
}