autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

feat(brew): add `--prefix` subcommand

Open bjsho opened this issue 3 years ago • 2 comments

Adding the --prefix subcommand

bjsho avatar Aug 20 '22 17:08 bjsho

Overview

src/brew.ts:

Info:

Script: brew services list | sed -e 's/ .*//' | tail -n +2 postProcess(function):

 function (out) {
    return out
      .split("\n")
      .filter((line) => !line.includes("unbound"))
      .map((line) => ({
        name: line,
        icon: "fig://icon?type=package",
        description: `${action} ${line}`,
      }));
  }

Script: brew list -1 postProcess(function):

 function (out) {
    return out
      .split("\n")
      .filter((line) => !line.includes("="))
      .map((formula) => ({
        name: formula,
        icon: "🍺",
        description: "Installed formula",
      }));
  }

Script: brew outdated -q postProcess(function):

 function (out) {
    return out.split("\n").map((formula) => ({
      name: formula,
      icon: "🍺",
      description: "Outdated formula",
    }));
  }

Script: HBPATH=$(brew --repository); ls -1 $HBPATH/Library/Taps/homebrew/homebrew-core/Formula $HBPATH/Library/Taps/homebrew/homebrew-cask/Casks postProcess(function):

 function (out) {
            return out.split("\n").map((formula) => {
              return {
                name: formula.replace(".rb", ""),
                description: "Formula",
                icon: "🍺",
                priority:
                  (formula[0] >= "0" && formula[0] <= "9") || formula[0] == "/"
                    ? 0
                    : 51,
              };
            });
          }

Script: brew list -1 --cask postProcess(function):

 function (out) {
                return out.split("\n").map((formula) => {
                  return {
                    name: formula,
                    icon: "🍺",
                    description: "Installed formula",
                  };
                });
              }

Script: HBPATH=$(brew --repository); ls -1 $HBPATH/Library/Taps/homebrew/homebrew-core/Formula $HBPATH/Library/Taps/homebrew/homebrew-cask/Casks postProcess(function):

 function (out) {
            return out.split("\n").map((formula) => {
              return {
                name: formula.replace(".rb", ""),
                description: "Formula",
                icon: "🍺",
                priority:
                  (formula[0] >= "0" && formula[0] <= "9") || formula[0] == "/"
                    ? 0
                    : 51,
              };
            });
          }

Single Scripts:

  • brew tap
  • HBPATH=$(brew --repository); ls -1 $HBPATH/Library/Taps/homebrew/homebrew-core/Formula $HBPATH/Library/Taps/homebrew/homebrew-cask/Casks

withfig-bot avatar Aug 20 '22 17:08 withfig-bot

Hello @ben5vik, 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.

withfig-bot avatar Aug 20 '22 17:08 withfig-bot

recheck

fedeci avatar Feb 10 '23 09:02 fedeci

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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


You can retrigger this bot by commenting recheck in this Pull Request

withfig-bot avatar Feb 10 '23 09:02 withfig-bot