30 Nov 2011 23:16
before-pull hook etc.
Tracy Reed <treed <at> ultraviolet.org>
2011-11-30 22:16:25 GMT
2011-11-30 22:16:25 GMT
As a sup newbie who has been trying to give sup a go for a month I actually
have several questions about sup but I'll start with the one in the subject:
I am running sup v0.12.1. I have a ~/.sup/hooks/before-pull.rb hook which
invokes offlineimap just as described in the wiki:
def offlineimap(*folders)
cmd = "offlineimap -q -u Noninteractive.Basic"
cmd << " -f #{folders * ','}" unless folders.compact.empty?
`#{cmd} 2>&1`
end
def folder_names(sources)
sources.map { |s| s.uri.split('/').last }
end
def inbox_sources(sources = Index.usual_sources)
sources.find_all { |s| !s.archived? }.sort_by {|s| s.id }
end
if ( <at> last_fetch || Time.at(0)) < Time.now - 120
say "Running offlineimap..."
# only check non-auto-archived sources on the first run
log offlineimap( <at> last_fetch ? nil : folder_names(inbox_sources))
say "Finished offlineimap run."
end
<at> last_fetch = Time.now
I put this in place, restarted sup, hit P and nothing different seems to
happen. It returns immediately and never says "finished offlineimap run". I'm
(Continue reading)
RSS Feed