Skip to content
Permalink
Browse files

fix(core): be more descriptive when a plugin/maker/publisher module i…

…sn't found
  • Loading branch information
malept committed Feb 13, 2019
1 parent 6c4acc1 commit 788412e38cfb7a0efa7202a39d45e47c78b4118b
@@ -103,7 +103,7 @@ export default async ({
const resolvableTarget: IForgeResolvableMaker = target as IForgeResolvableMaker;
const MakerClass = requireSearch<typeof MakerImpl>(dir, [resolvableTarget.name]);
if (!MakerClass) {
throw `Could not find module with name: ${resolvableTarget.name}`;
throw `Could not find module with name: ${resolvableTarget.name}. Make sure it's listed in the devDependencies of your package.json`;
}

maker = new MakerClass(resolvableTarget.config, resolvableTarget.platforms || undefined);
@@ -160,7 +160,7 @@ const publish = async ({
await asyncOra(`Resolving publish target: ${`${resolvablePublishTarget.name}`.cyan}`, async () => { // eslint-disable-line no-loop-func
PublisherClass = requireSearch(dir, [resolvablePublishTarget.name]);
if (!PublisherClass) {
throw `Could not find a publish target with the name: ${resolvablePublishTarget.name}`;
throw `Could not find a publish target with the name: ${resolvablePublishTarget.name}. Make sure it's listed in the devDependencies of your package.json`;
}
});

@@ -26,7 +26,7 @@ export default class PluginInterface implements IForgePluginInterface {
if (typeof plugin[1] !== 'undefined') opts = plugin[1];
const Plugin = requireSearch<any>(dir, [plugin[0]]);
if (!Plugin) {
throw `Could not find module with name: ${plugin[0]}`;
throw `Could not find module with name: ${plugin[0]}. Make sure it's listed in the devDependencies of your package.json`;
}
return new Plugin(opts);
}

0 comments on commit 788412e

Please sign in to comment.
You can’t perform that action at this time.