commit e0933e726e2214ea98ffbd967c0faf13e508eda0
parent 133fcaef9ccd6e4a42ea7671fecb7cba720dafe1
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sun, 7 Jul 2024 00:01:01 +0530
parent 133fcaef9ccd6e4a42ea7671fecb7cba720dafe1
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sun, 7 Jul 2024 00:01:01 +0530
Merge changes from github Sort files by recent
5 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/install b/install @@ -1,11 +0,0 @@ -#!/bin/sh - -set -x - -: ${DESTDIR:=/usr/local} -BINDIR="${DESTDIR}/bin" -MANDIR="${DESTDIR}/share/man" - -mkdir -p "${BINDIR}" "${MANDIR}/man1" -install -m0755 nb "${BINDIR}" -install -m0644 nb.1 "${MANDIR}/man1"
diff --git a/nb b/nb @@ -9,7 +9,7 @@ nb_fatal_error() { nb_browse() { cd "${NB_PATH}" - file="$(find . -not -wholename "**/.git*" -type f | ${FUZZER})" + file="$(find . -not -wholename "**/.git*" -type f -printf "%T@ %p\n" | sort -r | cut -d' ' -f 2 | ${FUZZER})" [ "${file}" != "" ] && ${EDITOR} "${file}" } @@ -54,7 +54,10 @@ which "${EDITOR}" >/dev/null 2>/dev/null || { export EDITOR=cat; } XDG_DATA_HOME="${XDG_DATA_HOME:=$HOME}" NB_PATH="${NB_PATH:=$XDG_DATA_HOME/notes}" -test -d "${NB_PATH}" || { nb_fatal_error "NB_PATH is not a directory"; exit 1; } +: ${XDG_DATA_HOME:=$HOME/.local/share} +: ${NB_PATH:=$XDG_DATA_HOME/notebook} + +test -d "${NB_PATH}" || { nb_fatal_error "NB_PATH: ${NB_PATH} is not a directory"; exit 1; } cd "${NB_PATH}" || nb_fatal_error "NB_PATH is not a directory" nb_option=${1} [ $# -ge 1 ] && shift