1
0
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:
Laurent Cozic 2022-01-07 12:04:59 +00:00
parent 1781334374
commit b36cf46a06
2 changed files with 3 additions and 1 deletions

View File

@ -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'));

View File

@ -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);