Skip to content

Commit

Permalink
Fix: Check if app is truly installed befare reading package.json (#978)
Browse files Browse the repository at this point in the history
* Fix: Check if app is truly installed before reading package.json
  • Loading branch information
kylebonnici authored Feb 12, 2024
1 parent 4bd9e2f commit 644d342
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
4 changes: 4 additions & 0 deletions Changelog.minor.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ release the new version.
- #950, #952: Use the refactored telemetry code.
- #958 Update electron from 22.x to 28.x

### Fixed

- #978 Do not convert legacy app if it has been uninstalled in the mean time

## 4.3.0

### Fixed
Expand Down
26 changes: 14 additions & 12 deletions src/main/apps/legacyMetaFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,20 @@ const migrateLegacyMetaFiles = (source: Source) => {
'package.json'
);

const packageJsonResult = parsePackageJsonLegacyApp(
readFile(packageJsonFile)
);

const packageJson = packageJsonResult.success
? packageJsonResult.data
: null;

writeAppInfo(
createNewAppInfo(appName, appsJson, updatesJson, packageJson),
source
);
if (fs.existsSync(packageJsonFile)) {
const packageJsonResult = parsePackageJsonLegacyApp(
readFile(packageJsonFile)
);

const packageJson = packageJsonResult.success
? packageJsonResult.data
: null;

writeAppInfo(
createNewAppInfo(appName, appsJson, updatesJson, packageJson),
source
);
}
});

createWithDrawnAppFiles('pc-nrfconnect-gettingstarted', source);
Expand Down

0 comments on commit 644d342

Please sign in to comment.