Yeah, but they could call their plugin "toString" or something. :-/


On Mon, Aug 12, 2013 at 4:05 PM, Dennis Kehrig <notifications@github.com>wrote:

> In lib/generator.js:
>
> > +            throw new Error("Attempted to load a plugin with a name that is already used. Path: '" +
> > +                directory + "', name: '" + metadata.name + "'");
> > +        }
> > +        // TODO: Also check that plugin is compatible with this version of Generator
> > +
> > +        // Do the actual plugin load
> > +        try {
> > +            // NOTE: We don't need to worry about accidentally requiring the same plugin twice.
> > +            // If the user did try to load it twice, require's caching would return the same
> > +            // package.json both times (even if the package.json changed on disk), and so
> > +            // we'd get the same name both times, and bail in the "if" branch above.
> > +            var plugin = require(directory),
> > +                config = this._config[metadata.name] || {};
> > +
> > +            plugin.init(this, config);
> > +            this._plugins[PLUGIN_KEY_PREFIX + metadata.name] = {
>
> Why the prefix? metadata.name is already guaranteed to be a non-empty
> string, right?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/adobe-photoshop/generator/pull/76/files#r5724138>
> .
>