summaryrefslogtreecommitdiff
path: root/scripts/sh/scr
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sh/scr')
-rwxr-xr-xscripts/sh/scr17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/sh/scr b/scripts/sh/scr
new file mode 100755
index 0000000..c0d26c3
--- /dev/null
+++ b/scripts/sh/scr
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Fuzzy finds in the scripts/sh directory.
+# Programs in Rust, etc. are not treated in the same way.
+# To make a new script, use "scr NAME".
+
+[ -z "$EDITOR" ] && echo "EDITOR not set" && exit
+[ -z "$FUZZY" ] && echo "FUZZY not set" && exit
+
+if [ -z "$1" ] ; then
+ FILE="$(find "$HOME/git/neodot/scripts/sh" -type f | $FUZZY)"
+ [ -z "$FILE" ] && exit 0
+ $EDITOR "$FILE"
+else
+ $EDITOR "$HOME/git/neodot/scripts/sh/$1"
+ chmod +x "$HOME/git/neodot/scripts/sh/$1"
+ update 2>&1
+fi