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

feat(cargo): export searchGenerator so other tools can use it #2504

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

miguelmig
Copy link
Contributor

No description provided.

@withfig-bot
Copy link
Collaborator

withfig-bot commented Nov 11, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@withfig-bot
Copy link
Collaborator

Overview

src/cargo.ts:

Info:

Single Functions:

custom:

 async function (tokens, executeCommand) {
    let makefileLocation = "Makefile.toml";

    const makefileFlagIdx = tokens.findIndex((param) => param === "--makefile");
    if (makefileFlagIdx !== -1 && tokens.length > makefileFlagIdx + 1)
      makefileLocation = tokens[makefileFlagIdx + 1];

    const args = [makefileLocation];
    const { stdout } = await executeCommand({
      command: "cat",
      args,
    });

    const taskRegex = /\[tasks\.([^\]]+)\]/g;
    let match;
    const tasks = [];

    while ((match = taskRegex.exec(stdout)) !== null) {
      tasks.push({
        name: match[1],
      });
    }

    return tasks;
  }

URLs:

  • https://crates.io/api/v1/crates/
  • https://crates.io/api/v1/crates?q=

@withfig-bot
Copy link
Collaborator

Hello @miguelmig,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments include the args property (args: {})?
  • Are all options modular? E.g. -a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

@miguelmig
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

withfig-bot added a commit that referenced this pull request Nov 11, 2024
@mschrage mschrage merged commit db6d0a8 into withfig:master Nov 22, 2024
5 checks passed
@withfig withfig locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants