mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-14 19:35:12 -05:00
feat: allow other configuration files under sparo profiles
This commit is contained in:
parent
ea8ab4cb68
commit
d7f4396ffb
1 changed files with 8 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue