Skip to content

Commit 02b57a8

Browse files
committed
plugins/todo: lint
plugin/base: use `_bash-it-component-item-is-enabled()`
1 parent 2e51e92 commit 02b57a8

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

clean_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ plugins/available/pyenv.plugin.bash
109109
plugins/available/rbenv.plugin.bash
110110
plugins/available/ruby.plugin.bash
111111
plugins/available/textmate.plugin.bash
112+
plugins/available/todo.plugin.bash
112113
plugins/available/xterm.plugin.bash
113114
plugins/available/zoxide.plugin.bash
114115

plugins/available/base.plugin.bash

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ function usage() {
120120
esac
121121
}
122122

123-
# shellcheck disable=SC2144 # the glob matches only one file
124-
if [[ ! -e "${BASH_IT?}/plugins/enabled/todo.plugin.bash" && ! -e "${BASH_IT?}/plugins/enabled"/*"${BASH_IT_LOAD_PRIORITY_SEPARATOR-}todo.plugin.bash" ]]; then
123+
if ! _bash-it-component-item-is-enabled plugin todo; then
125124
# if user has installed todo plugin, skip this...
126125
function t() {
127126
about 'one thing todo'

plugins/available/todo.plugin.bash

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
#!/bin/bash
2-
cite about-plugin
1+
# shellcheck shell=bash
32
about-plugin 'Todo.txt integration'
43

54
# you may override any of the exported variables below in your .bash_profile
6-
7-
if [ -z "$TODOTXT_DEFAULT_ACTION" ]; then
8-
# typing 't' by itself will list current todos
9-
export TODOTXT_DEFAULT_ACTION=ls
10-
fi
5+
: "${TODOTXT_DEFAULT_ACTION:=ls}"
6+
export TODOTXT_DEFAULT_ACTION
117

128
alias t='todo.sh'

0 commit comments

Comments
 (0)