Skip to content

Commit

Permalink
Store state and configuration in ~/.rss2email.
Browse files Browse the repository at this point in the history
If the current directory (typically the source directory) does not
contain a feeds.dat, create and use ~/.rss2email as a directory to
store feeds.dat (and optionally config.py).
  • Loading branch information
dme committed Mar 22, 2013
1 parent 3ee15ea commit 97a7b21
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion r2e
@@ -1,2 +1,22 @@
#!/bin/sh
python rss2email.py feeds.dat $*

set -e

FEEDS=feeds.dat

# Look for feeds.dat in the current directory and, if found, use that
# as configuration data. Otherwise, use ~/.rss2email as a directory to
# store the data.

if [ -f "${FEEDS}" ]; then
CFDIR=.
else
CFDIR="${HOME}/.rss2email"
fi

if [ ! -d "${CFDIR}" ]; then
mkdir "${CFDIR}"
fi

# Add $CFDIR to $PYTHONPATH so that config.py can be found.
PYTHONPATH="${CFDIR}:${PYTHONPATH}" python rss2email.py "${CFDIR}/${FEEDS}" $*

0 comments on commit 97a7b21

Please sign in to comment.