Skip to content

Commit

Permalink
Handle first time display of dependencies (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell committed Jun 12, 2023
1 parent 0651933 commit 3f43d78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/util.js
Expand Up @@ -84,7 +84,15 @@ export const getNewFiles = async rootDir => {
};

export const getNewDependencies = async (newPkg, rootDir) => {
let oldPkg = await git.readFileFromLastRelease(path.resolve(rootDir, 'package.json'));
let oldPkg;

try {
oldPkg = await git.readFileFromLastRelease(path.resolve(rootDir, 'package.json'));
} catch {
// Handle first time publish
return Object.keys(newPkg.dependencies ?? {});
}

oldPkg = JSON.parse(oldPkg);

const newDependencies = [];
Expand Down

0 comments on commit 3f43d78

Please sign in to comment.