mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Plugin Repo: Improved error message when plugin "publish" directory is missing
This commit is contained in:
parent
1781334374
commit
b36cf46a06
@ -51,6 +51,8 @@ async function extractPluginFilesFromPackage(existingManifests: any, workDir: st
|
||||
|
||||
const pluginDir = resolveRelativePathWithinDir(workDir, 'node_modules', packageName, 'publish');
|
||||
|
||||
if (!(await fs.pathExists(pluginDir))) throw new Error(`Could not find publish directory at ${pluginDir}`);
|
||||
|
||||
const files = await fs.readdir(pluginDir);
|
||||
const manifestFilePath = path.resolve(pluginDir, files.find((f: any) => path.extname(f) === '.json'));
|
||||
const pluginFilePath = path.resolve(pluginDir, files.find((f: any) => path.extname(f) === '.jpl'));
|
||||
|
@ -147,7 +147,7 @@ export function execCommand(command: string, options: any = null): Promise<strin
|
||||
});
|
||||
}
|
||||
|
||||
export function resolveRelativePathWithinDir(baseDir: string, ...relativePath: string[]) {
|
||||
export function resolveRelativePathWithinDir(baseDir: string, ...relativePath: string[]): string {
|
||||
const path = require('path');
|
||||
const resolvedBaseDir = path.resolve(baseDir);
|
||||
const resolvedPath = path.resolve(baseDir, ...relativePath);
|
||||
|
Loading…
Reference in New Issue
Block a user