From 52c78897315d2c76a730659763e9c53734beb6ba Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 31 Jan 2021 22:23:39 +0000 Subject: [PATCH] Plugin Repo: do not create errors.json file as errors are already logged to file --- packages/plugin-repo-cli/index.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/plugin-repo-cli/index.ts b/packages/plugin-repo-cli/index.ts index 83e24a66f..9f313aa7d 100644 --- a/packages/plugin-repo-cli/index.ts +++ b/packages/plugin-repo-cli/index.ts @@ -7,8 +7,7 @@ import validatePluginId from '@joplin/lib/services/plugins/utils/validatePluginI import { execCommand2, resolveRelativePathWithinDir, gitPullTry, gitRepoCleanTry, gitRepoClean } from '@joplin/tools/tool-utils.js'; import checkIfPluginCanBeAdded from './lib/checkIfPluginCanBeAdded'; import updateReadme from './lib/updateReadme'; -import { ImportErrors, NpmPackage } from './lib/types'; -import errorsHaveChanged from './lib/errorsHaveChanged'; +import { NpmPackage } from './lib/types'; import gitCompareUrl from './lib/gitCompareUrl'; function stripOffPackageOrg(name: string): string { @@ -149,7 +148,6 @@ function chdir(path: string): string { async function processNpmPackage(npmPackage: NpmPackage, repoDir: string) { const tempDir = `${repoDir}/temp`; const obsoleteManifestsPath = path.resolve(repoDir, 'obsoletes.json'); - const errorsPath = path.resolve(repoDir, 'errors.json'); await fs.mkdirp(tempDir); @@ -166,9 +164,6 @@ async function processNpmPackage(npmPackage: NpmPackage, repoDir: string) { chdir(packageTempDir); await execCommand2('npm init --yes --loglevel silent', { quiet: true }); - const errors: ImportErrors = await readJsonFile(errorsPath, {}); - delete errors[npmPackage.name]; - let actionType: ProcessingActionType = ProcessingActionType.Update; let manifests: any = {}; let manifest: any = {}; @@ -189,18 +184,9 @@ async function processNpmPackage(npmPackage: NpmPackage, repoDir: string) { } } catch (e) { console.error(e); - errors[npmPackage.name] = e.message || ''; error = e; } - if (Object.keys(errors).length) { - if (errorsHaveChanged(await readJsonFile(errorsPath, {}), errors)) { - await fs.writeFile(errorsPath, JSON.stringify(errors, null, '\t'), 'utf8'); - } - } else { - await fs.remove(errorsPath); - } - if (!error) { // We preserve the original manifests so that if a plugin has been removed // from npm, we still keep it. It's also a security feature - it means that