Skip to content

Commit

Permalink
added homebrew package
Browse files Browse the repository at this point in the history
  • Loading branch information
transgirllucy committed Dec 4, 2024
1 parent 46b250a commit 13a34db
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
# brewy
# brewy - alternative homebrew frontend

# entry point

- `src/index.ts`
- Invokes features
- `invokes`

# features

- `src/features` folder
- Package Installation: `install_package.ts`
- Package Search: `search.ts`
- Homebrew/Formula Update: `update.ts`
- Package Upgrade: `upgrade.ts`
- Package Uninstallation: `uninstall.ts`
- Homebrew Configuration: `config.ts`
- Formula/Cask Creation: `create.ts`
- Formula/Cask Editing: `edit.ts`

To install dependencies:

Expand All @@ -13,3 +31,6 @@ bun run src/index.ts
```

This project was created using `bun init` in bun v1.1.38. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.


![A diagram showing the architecture of a CLI for Homebrew, with the CLI entry point invoking various functions, including package installation, search, update, upgrade, uninstallation, configuration, creation, and editing, all of which use a command execution module to interact with the Homebrew external system. A visual representation of a Homebrew CLI architecture, illustrating the entry point of the CLI that triggers multiple functions such as package installation, search, update, upgrade, uninstallation, configuration, creation, and editing, all utilizing a command execution module to communicate with the Homebrew external system. A visual representation of a Homebrew CLI architecture, illustrating the entry point of the CLI that triggers multiple functions such as package installation, search, update, upgrade, uninstallation, configuration, creation, and editing, all utilizing a command execution module to communicate with the Homebrew external system. The diagram highlights the flow of commands from the user through the CLI to the various functionalities, showcasing how the system processes requests and interacts with the underlying package management infrastructure.](./assets/diagram.jpeg)
23 changes: 23 additions & 0 deletions brewy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Brewy < Formula
desc "Description of your project"
homepage "https://github.com/transgirllucy/brewy"
url "https://github.com/transgirllucy/brewy/releases/download/alpha/binaries.tar.gz"
sha256 "6f1d590b3d258dc9605ff41e78093a2a88b7beb0b0d79ad4b5fd1b85bcca416e"

def install
if OS.mac?
if Hardware::CPU.arm?
bin.install "dist/brewy-darwin-arm64" => "brewy"
elsif Hardware::CPU.intel?
bin.install "dist/brewy-darwin-x64" => "brewy"
end
elsif OS.linux?
if Hardware::CPU.intel
bin.install "dist/brewy-linux" => "brewy"
end
end

test do
system "#{bin}/brewy", "version" # Adjust this to a valid command for testing
end
end
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build:windows-modern": "bun build --compile --target=bun-windows-x64-modern ./src/index.ts --outfile=./dist/brewy-windows-modern",
"build:darwin-arm64": "bun build --compile --target=bun-darwin-arm64 ./src/index.ts --outfile=./dist/brewy-darwin-arm64",
"build:darwin-x64": "bun build --compile --target=bun-darwin-x64 ./src/index.ts --outfile=./dist/brewy-darwin-x64",
"build": "npm run build:linux && npm run build:windows && npm run build:darwin-x64 && npm run build:darwin-arm64"
"build": "npm run build:linux && npm run build:windows && npm run build:darwin-x64 && npm run build:darwin-arm64",
"homebrew": "bun run build && tar -czvf binaries.tar.gz ./dist/"
},
"devDependencies": {
"@types/bun": "latest",
Expand Down
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { handleUninstall } from './features/uninstall';
import { handleConfig } from './features/config';
import { handleCreate } from './features/create';
import { handleEdit } from './features/edit';
import { handleVersion } from './features/version';
const program = new Command();

program
Expand Down Expand Up @@ -134,6 +135,11 @@ program.command('uninstall <package>')
.action((args, options) => {
handleEdit(args, options);
});
program.command('version')
.description("shows the version")
.action(() => {
handleVersion();
});


program.parse(process.argv);
Expand Down

0 comments on commit 13a34db

Please sign in to comment.