Skip to content

Commit b9dab86

Browse files
committed
Merge branch 'master' of https://github.com/kylebebak/notes
2 parents 4b12295 + 3d77cf0 commit b9dab86

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

_helpers/helpers.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ function previewnotes {
8585

8686
}
8787

88+
function opennote {
89+
if [ -z "$EDITOR" ]; then
90+
open $1
91+
else
92+
eval "$EDITOR $1"
93+
fi
94+
}
95+
8896
# help
8997
# --------------------------------------------------
9098
unset usage

bin/notes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ while getopts "$optstring" opt; do
120120
n)
121121
checkname "$OPTARG"
122122
mkdir -p $(dirname "$OPTARG${_ext}") && touch "$OPTARG${_ext}"
123-
open "$OPTARG${_ext}"
123+
opennote "$OPTARG${_ext}"
124124
exit 0
125125
;;
126126

@@ -207,7 +207,7 @@ if [ -z "$2" ]; then
207207
exit 0
208208
fi
209209

210-
open $1${_ext}
210+
opennote $1${_ext}
211211
exit 0
212212
fi
213213

0 commit comments

Comments
 (0)