1
0
mirror of https://github.com/RyanGreenup/cadmus.git synced 2025-02-19 20:27:49 +01:00

Add Global Path Variable

This commit is contained in:
Ryan Greenup 2020-07-15 01:14:19 +10:00
parent e648fe05a3
commit 3e14c8f6f0
3 changed files with 6 additions and 4 deletions

View File

@ -22,10 +22,10 @@ main() {
# *** Skim and Grep, the important stuff
SkimAndGrep () {
## Change directory if One was specified
## Change directory if One was specified, exit if no directory exists
if [ "${1:-}" != "" ]; then
cd "${1}"
cd "${1}" || exit 4
fi
@ -89,7 +89,7 @@ arguments () {
while test $# -gt 0
do
case "$1" in
-d) SkimAndGrep $2 && exit 0
-d) SkimAndGrep "${2}" && exit 0
;;
--d) SkimAndGrep $2 && exit 0
;;

View File

@ -1,5 +1,5 @@
#! /usr/bin/env bash
#
NOTES_DIR="~/Notes/MD" ## TODO Global Variables are bad
# Author: Ryan Greenup <ryan.greenup@protonmail.com>
# abort on nonzero exitstatus
set -o errexit

View File

@ -11,6 +11,8 @@ Basically I would like to be able to change the note directory to manage seperat
etc.
This should be fed in as a ~-c~ option.
[[file:bin/cadmus::NOTES_DIR="~/Notes/MD" ## TODO Global Variables are bad][Refer to this line here]]
** Main Help
*** TODO [#C] Move Emojis
I should move the emojis to the end so that they don't interfere when using tty