Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec(git): Add remote generators + remove console.log #2134

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove console.log and add remote generators to git spec
  • Loading branch information
Zeko369 committed Oct 19, 2023
commit 114ef9158c054eedaf60a1b0547dbee0940a2cd8
14 changes: 13 additions & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const postProcessTrackedFiles: Fig.Generator["postProcess"] = (
interface PostProcessBranchesOptions {
insertWithoutRemotes?: true;
}

const postProcessBranches =
(options: PostProcessBranchesOptions = {}): Fig.Generator["postProcess"] =>
(out) => {
Expand Down Expand Up @@ -269,7 +270,6 @@ export const gitGenerators: Record<string, Fig.Generator> = {
const remoteURLs = out.split("\n").reduce((dict, line) => {
const pair = line.split("\t");
const remote = pair[0];
console.log(remote, pair);
const url = pair[1].split(" ")[0];

dict[remote] = url;
Expand Down Expand Up @@ -6312,6 +6312,8 @@ const completionSpec: Fig.Spec = {
args: [
{
name: "name",
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
{
name: "branch",
Expand Down Expand Up @@ -6345,6 +6347,8 @@ const completionSpec: Fig.Spec = {
args: [
{
name: "name",
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
{
name: "branch",
Expand Down Expand Up @@ -6390,6 +6394,8 @@ const completionSpec: Fig.Spec = {
],
args: {
name: "name",
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
},
{
Expand All @@ -6398,6 +6404,8 @@ const completionSpec: Fig.Spec = {
args: [
{
name: "name",
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
{
name: "newurl",
Expand Down Expand Up @@ -6430,6 +6438,8 @@ const completionSpec: Fig.Spec = {
args: {
name: "name",
isVariadic: true,
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
options: [
{
Expand All @@ -6446,6 +6456,8 @@ const completionSpec: Fig.Spec = {
args: {
name: "name",
isVariadic: true,
generators: gitGenerators.remotes,
filterStrategy: "fuzzy",
},
options: [
{
Expand Down