Skip to content

Commit

Permalink
brew install pkgxdev/made/pkgm
Browse files Browse the repository at this point in the history
Needs bump to be amended to be able to bump the right formula
  • Loading branch information
mxcl committed Jan 13, 2025
1 parent ff25d4d commit 144c1f0
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.pkgm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
paths:
- pkgm.rb

jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Homebrew/actions/setup-homebrew@master
- run: brew install --build-from-source ./pkgm.rb
- run: brew test pkgm
- run: brew audit pkgm
File renamed without changes.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Installing `pkgx` with Homebrew
# pkgx Tap

```sh
$ brew install pkgxdev/made/pkgx
brew install pkgxdev/made/pkgx || curl https://pkgx.sh | sh
```

## Uninstall

```sh
brew uninstall pkgxdev/made/pkgx || sudo rm /usr/local/bin/pkg[xm]
```
25 changes: 25 additions & 0 deletions pkgm.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Pkgm < Formula
desc "Install Anything"
homepage "https://github.com/pkgxdev/pkgm"
sha256 "981e92983199e4d6745f30777cbcb600457649e5a3a473ff489034cb769dc99e"
url "https://github.com/pkgxdev/pkgm/releases/download/v0.3.0/pkgm-0.3.0.tgz"
license "Apache-2.0"

livecheck do
url :stable
strategy :github_latest
end

depends_on "deno"

def install
# use the brew deno rather than pkgx deno
inreplace "pkgm", /pkgx deno.* run/, "deno run"

bin.install("pkgm")
end

test do
assert_equal shell_output("pkgm --version"), "pkgm #{version}"
end
end
10 changes: 6 additions & 4 deletions pkgx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class Pkgx < Formula
depends_on "unzip" => :build # deno >=1.39.1 uses unzip when remote-fetching their compilable runtime
depends_on "rust" => :build

on_linux do
depends_on "sqlite"
end

def install
if File.file? "Cargo.toml"
system "cargo", "build", "--release"
bin.install "target/release/pkgx"

system "curl" "-o", "pkgm", "https://pkgxdev.github.io/pkgm/pkgm.ts"
bin.install "pkgm"
bin.join("pkgm").chmod 0755
else
system "deno", "task", "compile"
bin.install "pkgx"
Expand All @@ -48,5 +48,7 @@ def install
with_env("PKGX_DIR" => testpath/".pkgx") do
assert_equal "hello, world", shell_output("#{bin}/pkgx deno run '#{testpath}/hello.js'").chomp
end

system bin.join("pkgm"), "--version"
end
end

0 comments on commit 144c1f0

Please sign in to comment.