todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.56k stars 713 forks source link

check current working dir for todo/ else use values from config file #357

Closed alipirpiran closed 3 years ago

alipirpiran commented 3 years ago

feature

check current working directory for todo/ directory.

inkarkat commented 3 years ago

Duplicate of #187 (which doesn't require a todo/ subdir, which I find unnecessary; the filenames are already specific enough).

Also, this can be easily done via customization in todo.cfg, so you don't have to wait for the feature to be implemented - the feature would only make this even easier.

jesseops commented 2 years ago

For anyone else looking for how to implement the described customization in todo.cfg, here's what I added to mine so that I could have project-specific todo.txt files (eg, in a git repo):

❯ head ~/.todo.cfg
# === EDIT FILE LOCATIONS BELOW ===

# Your todo.txt directory (this should be an absolute path)
if test -f "${PWD}/todo.txt"; then
  export TODO_DIR=$PWD
else
  export TODO_DIR=$HOME/todo.txt
fi

# Your todo/done/report.txt locations

Note that this will create the done.txt,report.txt, etc files in the same directory.

resistor4u commented 2 years ago

@jesseops good suggestion. I'm in the same situation, but trying to keep todo.cfg in a Box Sync directory and in my case, the admins insist on keeping the default Box Sync name. Properly escaping the space across different machines is a problem I haven't solved yet, but this little function is helpful to the point that adding it in documentation or comments would be a welcome feature.