Fix directory bug
Fix not getting back to starting dir
This commit is contained in:
parent
51f11ba994
commit
5595885bbc
10 changed files with 26 additions and 7 deletions
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function delnote() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter the name of the note you want to delete: " && read delete
|
||||
else
|
||||
|
@ -42,4 +43,5 @@ function delnote() {
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
cd $DIR
|
||||
}
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function findmisplacednote() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
else
|
||||
|
@ -19,4 +20,5 @@ function findmisplacednote() {
|
|||
echo "Possible locations: "
|
||||
find ~/ -iname $notename -print 2>/dev/null
|
||||
fi
|
||||
cd $DIR
|
||||
}
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function findnote() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
else
|
||||
|
|
|
@ -6,7 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function listnotes() {
|
||||
|
||||
DIR="$(pwd)"
|
||||
listnotesFunc () {
|
||||
|
||||
NOTES="`ls $DEFAULT_PATH --color=always `"
|
||||
|
@ -42,4 +42,5 @@ function listnotes() {
|
|||
fi
|
||||
esac
|
||||
return 0
|
||||
cd $DIR
|
||||
}
|
||||
|
|
|
@ -6,13 +6,12 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function newnote() {
|
||||
|
||||
DIR="$(pwd)"
|
||||
cd $DEFAULT_PATH
|
||||
$NOTES_EDITOR
|
||||
clear
|
||||
cd $DIR
|
||||
str="Note created in $DEFAULT_PATH"
|
||||
underlines=$(echo "$str" | tr -c '\010' '-')
|
||||
echo "$str\n$underlines"
|
||||
|
||||
cd $DIR
|
||||
}
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function notewc() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
else
|
||||
|
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function quicknote() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
else
|
||||
|
|
|
@ -6,23 +6,33 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function quickread() {
|
||||
DIR="$(pwd)"
|
||||
check_params() {
|
||||
case $1 in
|
||||
-parameter | --parameter )
|
||||
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
elif [ $# -gt 1 ]; then
|
||||
check_params
|
||||
else
|
||||
notename=$1
|
||||
fi
|
||||
|
||||
cd $DEFAULT_PATH
|
||||
if [ -e $notename ]; then
|
||||
clear
|
||||
|
||||
if [ "$(cat $notename | wc -l)" -ge 25 ];then
|
||||
if [ "$(cat $notename | wc -l)" -ge 25 ]; then
|
||||
cat $notename | less
|
||||
else
|
||||
cat $notename
|
||||
fi
|
||||
|
||||
else
|
||||
clear
|
||||
echo "No such note."
|
||||
fi
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function readnote() {
|
||||
DIR="$(pwd)"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
else
|
||||
|
|
|
@ -6,6 +6,7 @@ in /docs/github/ for its full text.
|
|||
info
|
||||
|
||||
function renamenote() {
|
||||
DIR="$(pwd)"
|
||||
cd $DEFAULT_PATH
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -n "Enter note name: " && read notename
|
||||
|
|
Loading…
Reference in a new issue