Skip to content

Commit

Permalink
fix(tgenv): add trim in generators
Browse files Browse the repository at this point in the history
  • Loading branch information
yinchuandong committed Mar 15, 2022
1 parent 8c936f4 commit 1016fe2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/tgenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ const generators: Record<string, Fig.Generator> = {
installedVersions: {
script: "tgenv list",
postProcess: function (out) {
return out.split("\n").map((tfversion) => {
return { name: tfversion, description: "Version" };
});
return out
.trim()
.split("\n")
.map((tfversion) => {
return { name: tfversion, description: "Version" };
});
},
},
allVersions: {
script: "tgenv list-remote",
postProcess: function (out) {
return out.split("\n").map(function (line) {
return { name: line, type: "option" };
});
return out
.trim()
.split("\n")
.map(function (line) {
return { name: line, type: "option" };
});
},
},
};
Expand Down

0 comments on commit 1016fe2

Please sign in to comment.