Изменил(а) на 'note'
This commit is contained in:
parent
740d68473f
commit
dffce1d596
22
note
22
note
@ -6,7 +6,7 @@ CMD_INSERT(){
|
||||
path=$1
|
||||
mkdir -p -v "$NOTESPATH/$(dirname -- "$path")" &> /dev/null
|
||||
path="$NOTESPATH/$path.md"
|
||||
$EDITOR $path
|
||||
$EDITOR "$path"
|
||||
}
|
||||
|
||||
CMD_HELP(){
|
||||
@ -32,18 +32,18 @@ _EOF
|
||||
}
|
||||
|
||||
CMD_INIT(){
|
||||
test -d $NOTESPATH && echo "Note Store already exist" && exit 0 ||
|
||||
mkdir $NOTESPATH &> /dev/null
|
||||
echo "New note storage creted to: $NOTESPATH"
|
||||
test -d "$NOTESPATH" && echo "Note Store already exist" && exit 0 ||
|
||||
mkdir "$NOTESPATH" &> /dev/null
|
||||
echo "New note storage creted to: "$NOTESPATH""
|
||||
exit 0
|
||||
}
|
||||
|
||||
CMD_SHOWTREE(){
|
||||
if [ ! -z $1 ]; then
|
||||
glow -p $NOTESPATH/$1.md
|
||||
if [ ! -z "$1" ]; then
|
||||
glow -p $NOTESPATH/"$1.md"
|
||||
else
|
||||
echo "Note Store"
|
||||
tree -N -C -l --noreport $NOTESPATH | tail -n +2 |\
|
||||
tree -N -C -l --noreport "$NOTESPATH" | tail -n +2 |\
|
||||
sed -E 's/\.md(\x1B\[[0-9]+m)?( ->|$)/\1\2/g'
|
||||
fi
|
||||
exit 0
|
||||
@ -79,10 +79,10 @@ CMD_SHOWVERSION(){
|
||||
echo $PROGRAM version: $VER
|
||||
}
|
||||
|
||||
if [[ ! $1 = init ]]; then
|
||||
test -d $NOTESPATH || CMD_HELP
|
||||
if [[ ! "$1" = init ]]; then
|
||||
test -d "$NOTESPATH" || CMD_HELP
|
||||
fi
|
||||
if [ -z $1 ]; then
|
||||
if [ -z "$1" ]; then
|
||||
CMD_SHOWTREE
|
||||
fi
|
||||
|
||||
@ -102,6 +102,6 @@ case "$1" in
|
||||
*) CMD_HELP "$@" ;;
|
||||
esac
|
||||
|
||||
find $NOTESPATH* -maxdepth 0 -type f ! -name *.md -delete &> /dev/null
|
||||
find "$NOTESPATH"* -maxdepth 0 -type f ! -name *.md -delete &> /dev/null
|
||||
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user