zpm-project / zpm-zsh

zsh plugin manager in ansi C.
GNU General Public License v3.0
5 stars 3 forks source link

Avoid installing plugin twice #1

Closed desyncr closed 7 years ago

desyncr commented 7 years ago

If a user tries to install a plugin twice we should

1) warn the user the plugin in already installed 2) return immediately

Migrated from: https://github.com/desyncr/zpm-zsh/issues/27

fennecdjay commented 7 years ago

Wouldn't a plugin_entry_exists() function, checking .plugin_list for the entry do the job?

    } else {
        if (plugin_entry_exists()) {
            zpm_message(ZPM_ERROR, "plugin \"%s\" already installed.\n", plugin_name);
            return 1;
        }
        plugin_name = malloc(PATH_MAX);
        strcpy(plugin_name, plugin_name_or_command);
    }
int status = strstr(plugin_name, "/") ? 0 : -1; ...
fennecdjay commented 7 years ago

see #14.

fennecdjay commented 7 years ago

You can probably close this too.

desyncr commented 7 years ago

Oh, yeah. Moving really fast, which is great! :D