Change curl request to format string

Put plugin manager installation in plugin selection and only if plugins are selected
This commit is contained in:
Marcel Schwarz 2020-01-11 05:12:05 +01:00
parent 92fad36fce
commit b15474edaf

View File

@ -30,11 +30,10 @@ class VimModule(AbstractModule):
if os.path.isfile(str(get_vim_root().joinpath("autoload", "plug.vim"))): if os.path.isfile(str(get_vim_root().joinpath("autoload", "plug.vim"))):
print("Vimplug already installed!") print("Vimplug already installed!")
else: else:
pluginmanager_url = self.json_config['pluginmanager_url'] curl_request = "curl {} -o {}".format(
curl_request = "curl " + \ self.json_config['pluginmanager_url'],
pluginmanager_url + \
" -o " + \
str(get_vim_root().joinpath("autoload", "plug.vim")) str(get_vim_root().joinpath("autoload", "plug.vim"))
)
subprocess.call(curl_request, shell=True) subprocess.call(curl_request, shell=True)
def create_plugin_section(self): def create_plugin_section(self):
@ -50,6 +49,8 @@ class VimModule(AbstractModule):
} }
] ]
selected_plugins = prompt(plugin_selection)['modules'] selected_plugins = prompt(plugin_selection)['modules']
if len(selected_plugins) > 0:
self.get_vimplug_file()
print("\033[4mYour selection:\033[0m") print("\033[4mYour selection:\033[0m")
[print(x) for x in selected_plugins] [print(x) for x in selected_plugins]
@ -101,7 +102,6 @@ class VimModule(AbstractModule):
def run(self): def run(self):
self.create_folder_structure() self.create_folder_structure()
self.get_vimplug_file()
plugin_section = self.create_plugin_section() plugin_section = self.create_plugin_section()
settings_section = self.create_setting_section() settings_section = self.create_setting_section()
self.write_vimfile(settings_section + plugin_section) self.write_vimfile(settings_section + plugin_section)