From d7f4396ffb4bd3f73eeaa0b6cc14127a9b406cec Mon Sep 17 00:00:00 2001 From: Cheng Liu Date: Fri, 1 Mar 2024 13:11:07 -0800 Subject: [PATCH] feat: allow other configuration files under sparo profiles --- apps/sparo-lib/src/services/SparoProfileService.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/sparo-lib/src/services/SparoProfileService.ts b/apps/sparo-lib/src/services/SparoProfileService.ts index 83f9842..0b113e3 100644 --- a/apps/sparo-lib/src/services/SparoProfileService.ts +++ b/apps/sparo-lib/src/services/SparoProfileService.ts @@ -33,12 +33,18 @@ export class SparoProfileService { }); await Async.forEachAsync(sparoProfilePaths, async (sparoProfilePath: string) => { + if (path.extname(sparoProfilePath) !== '.json') { + // No need to handle non-JSON files. + return; + } let sparoProfile: SparoProfile | undefined; try { sparoProfile = await SparoProfile.loadFromFileAsync(this._terminalService, sparoProfilePath); } catch (e) { - // TODO: more error handling - this._terminalService.terminal.writeErrorLine((e as Error).message); + this._terminalService.terminal.writeErrorLine( + `Failed to load sparo profile from ${sparoProfilePath}` + ); + this._terminalService.terminal.writeDebugLine((e as Error).message); } if (sparoProfile) {