| Hash | Commit message | Author | Date | Files | + | - |
1 | commit ff34676572d36b4c85939e54ea6a9ea58c9b76e2 |
2 | Author: Connor Etherington <[email protected]> |
3 | Date: Wed Aug 24 21:18:54 2022 +0200 |
4 | |
5 | Auto-Commit Update - 20220824 |
6 | --- |
7 | PKGBUILD | 2 +- |
8 | usr/bin/nav | 12 ++++++------ |
9 | 2 files changed, 7 insertions(+), 7 deletions(-) |
10 | |
11 | diff --git a/PKGBUILD b/PKGBUILD |
12 | index 2a7af0e..b8471a6 100644 |
13 | --- a/PKGBUILD |
14 | +++ b/PKGBUILD |
15 | @@ -1,7 +1,7 @@ |
16 | # Maintainer: Connor Etherington <[email protected]> |
17 | # --- |
18 | pkgname=nav |
19 | -pkgver=1.0.1 |
20 | +pkgver=1.0.2 |
21 | pkgrel=1 |
22 | pkgdesc="A means of quick navigation through directories in the CLI" |
23 | arch=(any) |
24 | diff --git a/usr/bin/nav b/usr/bin/nav |
25 | index 4fb7a2d..7f920e7 100755 |
26 | --- a/usr/bin/nav |
27 | +++ b/usr/bin/nav |
28 | @@ -15,7 +15,7 @@ GETPATH(){ |
29 | SELECT_PATH=$(dialog \ |
30 | --title "${TITLE}" --no-tags --stdout \ |
31 | --menu "${1}" \ |
32 | - 35 65 35 "UP" "* GO UP A DIRECTORY" "SELECT" "* SELECT MODE" \ |
33 | + 35 65 35 "UP" "* GO UP A DIRECTORY" "SELECT" "* SELECT THIS ($(basename ${PWD})) DIRECTORY" \ |
34 | $(for x in `find . -maxdepth 1 -type d|cut -d\ -f1|sed 's/^\.$//;s/^\.\.//;s/^\.\///'` ; |
35 | do echo "${x} ${x}" ; done ; unset x)) || exit 1 |
36 | } |
37 | @@ -31,7 +31,7 @@ GETCMD(){ |
38 | ISCORRECT(){ |
39 | CORRECT=$(dialog \ |
40 | --title "${TITLE}" \ |
41 | - --yesno "\\nIs this correct?\\n\\nTrigger: ${CMD}\\n\\nDirectory: `realpath ${SELECT_PATH}`\\n" \ |
42 | + --yesno "\\nIs this correct?\\n\\nTrigger: ${CMD}\\n\\nDirectory: ${1}\\n" \ |
43 | 12 70 3>&1 1>&2 2>&3 3>&1) || $0 |
44 | } |
45 | |
46 | @@ -55,15 +55,15 @@ while [[ ${SELECTION} == "" ]] ; do |
47 | |
48 | GETPATH "${TEXT}" && case ${SELECT_PATH} in |
49 | "UP") cd .. ;; |
50 | - "SELECT") unset SELECTION && GETPATH "${SELECT_MODE}" && SELECTION=${SELECT_PATH} ;; |
51 | + "SELECT") SELECTION=${PWD} ;; |
52 | *) ! cd ${SELECT_PATH} && dialog --title "${TITLE}" --msgbox "\\n Directory not found.\\n" 10 70 ;; |
53 | esac |
54 | done |
55 | |
56 | |
57 | -ISCORRECT && cat ${CONFIG}|grep -q "${CMD}=" && |
58 | - sed -i "s|alias ${CMD}=.*|alias ${CMD}='cd `realpath ${SELECTION}` ; ls -a'|" ${CONFIG} || |
59 | - echo "alias ${CMD}='cd `realpath ${SELECTION}` ; ls -a'" >> ${CONFIG} |
60 | +ISCORRECT ${SELECTION} && cat ${CONFIG}|grep -q "${CMD}=" &&[41m |
61 | + sed -i "s|alias ${CMD}=.*|alias ${CMD}='cd `realpath ${SELECTION}` ; ls -1a'|" ${CONFIG} || |
62 | + echo "alias ${CMD}='cd `realpath ${SELECTION}` ; ls -1a'" >> ${CONFIG} |
63 | |
64 | |
65 | |