nicferrier/emacs-marmalade-upload — pull request #1 by ardumont (2014-06-11 14:06:09+00:00)
Title: Add the means to retrieve token file from disk as cache fallback (if not found on default cache)

Hello,

Just a proposal.

I used a script command before that did the upload.
It does not work at the moment.

But this package does.
There is a slight workflow difference with my own.
I load the token from disk.

This script just loaded the token file ~/.marmalade/token and provided
it to curl as an option.

For deploying my latest package, I tricked marmalade-upload `(puthash "ardumont"
my-token marmalade/tokens)`.

So I just extracted a function that retrieved the token.
If first tries as originally from the cache.
If nothing is found, try to load the `~/.marmalade/` if the file exists.
If it does, it loads its content (which is assumed to be exactly the
token).
If nothing is found, returns nil.

This function is used at 2 positions:
- when computing the arguments to determine if the password is needed or not
- in the lambda when doing the actual upload request

As I do not know if you are interested at all, I did not:
- adapt the removal steps when the token is invalid (the token file could be removed?)
- nor update the cache with the token file's content (the token file's content can be poured into the cache?)

Cheers,