Compare commits
No commits in common. "631729fe093c72c521d7ba47e5fd3cfcef2b773b" and "0405ec702329c5d64c384a6663d7fdd6a793f2dc" have entirely different histories.
631729fe09
...
0405ec7023
20
e
20
e
|
@ -1,20 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
editors=""
|
||||
|
||||
for editor in ed nex nvi vim; do
|
||||
if command -v "$editor" >/dev/null; then
|
||||
if test -z "$editors"; then
|
||||
editors="$editor"
|
||||
else
|
||||
editors="$editors\n$editor"
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
random_editor="$(echo "$editors" | shuf | head -n 1)"
|
||||
|
||||
$random_editor "$@"
|
23
nx
23
nx
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
error() {
|
||||
echo "$@" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
test ! -d "$HOME/code/scripts" && error "No $HOME/code/scripts/ directory found"
|
||||
test -z "$1" && error "No script name given"
|
||||
test -f "$1" && error "$1 already exists"
|
||||
|
||||
fullpath="$HOME/code/scripts/$1"
|
||||
touch "$fullpath" && chmod +x "$fullpath"
|
||||
|
||||
test -n "$EDITOR" && $EDITOR "$fullpath"
|
||||
test -n "$VISUAL" && $VISUAL "$fullpath"
|
||||
if command -v vi 1>/dev/null; then
|
||||
vi "$fullpath"
|
||||
else
|
||||
error "No editor program found (set \$EDITOR or \$VISUAL, or install \`vi\`)"
|
||||
fi
|
Loading…
Reference in New Issue