Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
INSTALL_DIR=$HOME/bin
ALIAS_FILE=$HOME/.bashrc
prog="[""$(basename $0)""] "

THIS_SCRIPT=$(readlink -f $0)
CODE_DIR=$(dirname $THIS_SCRIPT)
prog="[""$(basename $THIS_SCRIPT)""] "

Usage(){
echo "Usage: $(basename $0) [options]"
Expand Down Expand Up @@ -53,22 +54,25 @@ while [[ $# -gt 0 ]] ; do
esac
done

[[ -d $INSTALL_DIR ]] || mkdir -p $INSTALL_DIR


#[[ -d $INSTALL_DIR ]] || mkdir -p $INSTALL_DIR
echo $prog"$INSTALL_DIR exists."

[[ -s $INSTALL_DIR/todo.py ]] && Update
#[[ -s $INSTALL_DIR/todo.py ]] && Update

[[ -s $ALIAS_FILE ]] || echo "# Bash RC File" >> $ALIAS_FILE
#[[ -s $ALIAS_FILE ]] || echo "# Bash RC File" >> $ALIAS_FILE
echo $prog"$ALIAS_FILE exists."
## Believe it or not, >> is faster than >.

echo $prog"Copying todo.py to $INSTALL_DIR/todo.py"
if [[ ! -f $INSTALL_DIR/todo.py ]] ; then
cp ./todo.py $INSTALL_DIR
cp ${CODE_DIR}/todo.py $INSTALL_DIR
else
cp -u ./todo.py $INSTALL_DIR
cp -u ${CODE_DIR}/todo.py $INSTALL_DIR
fi


## Establish alias
pre="\n\n#Alias for todo.py\n"
if grep -q -e "todo.sh" -e "todo.py" "$ALIAS_FILE" ; then
Expand Down
4 changes: 2 additions & 2 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,8 @@ def prepend_todo(args):
@usage('\thelp | h',
'\t\tDisplay this message and exit.\n')
def cmd_help():
print(concat(["Use", CONFIG["TODO_PY"], "-h for option help\n"], " "))
print(concat(["Usage:", CONFIG["TODO_PY"], "command [arg(s)]"], " "))
print(concat(["Use", os.path.basename(CONFIG["TODO_PY"]), "-h for option help\n"], " "))
print(concat(["Usage:", os.path.basename(CONFIG["TODO_PY"]), "command [arg(s)]"], " "))
d = {}
for (key, val) in commands.items():
d[val[1]] = (key, val[1])
Expand Down