do not error on fresh installs (#568)

This commit is contained in:
ABevier 2023-05-05 22:56:42 -04:00 committed by GitHub
parent 7f8f87cdc7
commit c50a0058b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,12 @@ export const getGuiPath = () => {
export async function getInstalledPackages(): Promise<InstalledPackage[]> { export async function getInstalledPackages(): Promise<InstalledPackage[]> {
const pkgsPath = getTeaPath(); const pkgsPath = getTeaPath();
if (!fs.existsSync(pkgsPath)) {
log.info(`packages path ${pkgsPath} does not exist, no installed packages`);
return [];
}
log.info("recursively reading:", pkgsPath); log.info("recursively reading:", pkgsPath);
const folders = await deepReadDir({ const folders = await deepReadDir({
dir: pkgsPath, dir: pkgsPath,