Skip to content

Allow setting plugin name#30

Open
jfhbrook wants to merge 2 commits intoctorgalson:masterfrom
jfhbrook:plugin-name
Open

Allow setting plugin name#30
jfhbrook wants to merge 2 commits intoctorgalson:masterfrom
jfhbrook:plugin-name

Conversation

@jfhbrook
Copy link

Very nice little ansible role!

I added a small feature - allowing to set the name of the plugin instead of using the basename of the git repo. This is handy if the plugin's repo is named something silly like "vim" - for example, the dracula plugin.

I'm not quite an expert at ansible, so there might be a better way to do this. Happy to iterate with feedback!

@ctorgalson
Copy link
Owner

This is an excellent idea.

I think a marginally better way would be to remove the new fact and its accompanying check and change this original line from:

    vim_plugin_name: "{{ (vim_plugin_install.repo | basename | splitext)[0] }}"

...to:

    vim_plugin_name: "{{ vim_plugin_install.name | default((vim_plugin_install.repo | basename | splitext)[0]) }}"

@jfhbrook
Copy link
Author

Again, sorry that I missed the notification on this.

Yeah, that seems reasonable to me. I'm unfortunately strapped for time and don't think I'll find the space to submit this fix. But I agree that this sounds better.

@jfhbrook
Copy link
Author

I was able to find the time to give this an update. I tried your suggestion and it worked on my machine! Let me know what you think, I'll try to be more responsive to notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants