mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-25 21:55:49 +00:00
fix: filter existing paths for apispec in workspace (#7104)
This commit is contained in:
@@ -211,15 +211,17 @@ const registerWorkspaceIpc = (mainWindow, workspaceWatcher) => {
|
||||
|
||||
const specs = workspaceConfig.specs || [];
|
||||
|
||||
const resolvedSpecs = specs.map((spec) => {
|
||||
if (spec.path && !path.isAbsolute(spec.path)) {
|
||||
return {
|
||||
...spec,
|
||||
path: path.join(workspacePath, spec.path)
|
||||
};
|
||||
}
|
||||
return spec;
|
||||
});
|
||||
const resolvedSpecs = specs
|
||||
.map((spec) => {
|
||||
if (spec.path && !path.isAbsolute(spec.path)) {
|
||||
return {
|
||||
...spec,
|
||||
path: path.join(workspacePath, spec.path)
|
||||
};
|
||||
}
|
||||
return spec;
|
||||
})
|
||||
.filter((spec) => spec.path && fs.existsSync(spec.path));
|
||||
|
||||
return resolvedSpecs;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user