Skip to content

Commit

Permalink
fix(conda): getInstalledPackages generator (withfig#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshjeet2003 authored Aug 8, 2024
1 parent 37804d0 commit 2ac3ba3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/conda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ const getInstalledPackages: Fig.Generator = {
postProcess: function (out) {
const lines = out.split("\n");
const installedPackages = [];
for (let i = 2; i < lines.length; i++) {
installedPackages.push({
name: lines[i],
icon: "🐍",
});
for (let i = 3; i < lines.length; i++) {
const line = lines[i].trim();
if (line) {
const packageName = line.split(/\s+/)[0];
installedPackages.push({
name: packageName,
icon: "🐍",
});
}
}
return installedPackages;
},
Expand Down

0 comments on commit 2ac3ba3

Please sign in to comment.