Skip to content

Commit

Permalink
fix: filter out empty lines when getting the sources
Browse files Browse the repository at this point in the history
  • Loading branch information
oae committed Oct 27, 2022
1 parent a3a9252 commit b150575
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/utils/mangal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ export const getAvailableSources = async () => {
try {
const { stdout, command } = await execa('mangal', ['sources', '-r']);
logger.info(`Get available sources with following command: ${command}`);
return stdout.split('\n').map((s) => s.trim());
return stdout
.split('\n')
.map((s) => s.trim())
.filter((s) => !!s);
} catch (err) {
logger.error(`Failed to get available sources: err: ${err}`);
logger.error(`Failed to get available sources. err: ${err}`);
}

return [];
Expand Down

0 comments on commit b150575

Please sign in to comment.