Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When adding an account via Alfred for the first time, the config file is being corrupted #15

Open
golimpio opened this issue Nov 5, 2014 · 3 comments
Labels

Comments

@golimpio
Copy link
Collaborator

golimpio commented Nov 5, 2014

If you add an account for the first time using Alfred (instead of creating the file manually), the plugin is adding some comments to the end of the configuration file.

These comments cannot be parsed by the plugin, making it fail.

We could do one of the following to fix it:

  • Stop adding comments
  • Add support for comments
  • (Suggestions??)

Example:

When I added my gmail account for the first time (via Alfred), the configuration file was created with the following data:

[fulano@gmail.com]
secret = a1b1 c1c2 b1b2 d3d4 asdf ghij zxc1 qwe3

xxxxxxxxxxxxxxxx
#
#[evernote - robert]
#secret=yyyyyyyyyyyyyyyyyy

A fixed ~/.gauth file would look like the following:

[fulano@gmail.com]
secret = a1b1 c1c2 b1b2 d3d4 asdf ghij zxc1 qwe3
@golimpio
Copy link
Collaborator Author

golimpio commented Nov 5, 2014

I'm not sure, but the problem might be the sequence of x's (xxxxxxxxxxxxxxxx) and not the comments.

@moul
Copy link
Owner

moul commented Nov 5, 2014

It's strange, the current default file is :

_CONFIG_FILE_INITIAL_CONTENT = \
    """#Examples of valid configurations:
#[google - bob@gmail.com]
#secret=xxxxxxxxxxxxxxxxxx
#
#[evernote - robert]
#secret=yyyyyyyyyyyyyyyyyy
"""

(https://github.com/moul/alfred-workflow-gauth/blob/master/src/gauth.py#L20-L26)

How to you installed the workflow ? from packal ? It may be outdated

@golimpio
Copy link
Collaborator Author

golimpio commented Nov 5, 2014

I don't remember how I've installed it, but I think I had the last version from trunk on my computer.

Looking at your comment, it looks like the config file initial content was written to the initial .gauth file and then, when adding the new key via the plugin, it overlapped the original content (that's the reason of the xxxxxxxxx without a comment on my example.

We should have appended the new key to the end of the file, not to the beginning - probably I've written this part of the code :)

@moul moul added the freeze label Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants