File tree Expand file tree Collapse file tree 2 files changed +21
-16
lines changed
Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ function passgen() {
6767
6868# Create alias pass to passgen when pass isn't installed or
6969# BASH_IT_LEGACY_PASS is true.
70- if ! _command_exists pass || [[ " ${BASH_IT_LEGACY_PASS:- } " = true ]]; then
70+ if ! _command_exists pass || [[ " ${BASH_IT_LEGACY_PASS:- } " == true ]]; then
7171 alias pass=passgen
7272fi
7373
@@ -120,19 +120,26 @@ function usage() {
120120 esac
121121}
122122
123- if ! _bash-it-component-item-is-enabled plugin todo; then
124- # if user has installed todo plugin, skip this...
125- function t() {
126- about ' one thing todo'
127- param ' if not set, display todo item'
128- param ' 1: todo text'
129- if [[ " $* " == " " ]]; then
130- cat ~ /.t
131- else
132- echo " $* " > ~ /.t
133- fi
134- }
135- fi
123+ function t() {
124+ about ' todo.sh if available, otherwise one thing todo'
125+ param ' if not set, display todo item'
126+ param ' 1: todo text'
127+
128+ local todotxt=" ${XDG_STATE_HOME:- ~/ .local/ state} /bash_it/todo.txt"
129+
130+ if _bash-it-component-item-is-enabled plugin todo; then
131+ todo.sh " $@ "
132+ return
133+ elif [[ ! -f " ${todotxt} " && -f ~ /.t ]]; then
134+ mv -vn ~ /.t " ${todotxt} " # Verbose, so the user knows. Don't overwrite, just in case.
135+ fi
136+
137+ if [[ " $# " -eq 0 ]]; then
138+ cat " ${todotxt} "
139+ else
140+ echo " $@ " > | " ${todotxt} "
141+ fi
142+ }
136143
137144if _command_exists mkisofs; then
138145 function mkiso() {
Original file line number Diff line number Diff line change @@ -4,5 +4,3 @@ about-plugin 'Todo.txt integration'
44# you may override any of the exported variables below in your .bash_profile
55: " ${TODOTXT_DEFAULT_ACTION:= ls} "
66export TODOTXT_DEFAULT_ACTION
7-
8- alias t=' todo.sh'
You can’t perform that action at this time.
0 commit comments