File tree Expand file tree Collapse file tree 8 files changed +36
-42
lines changed
Expand file tree Collapse file tree 8 files changed +36
-42
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ BrewKit is build infrastructure for `pkgx`.
66
77``` sh
88$ env +brewkit
9- $ pkg build zlib.net
9+ $ pkg build node
1010```
1111
1212If you are inside a pantry then BrewKit will figure out what packages you are
@@ -15,8 +15,10 @@ editing and build them.
1515``` sh
1616$ cd pantry
1717$ dev
18+ $ pkg edit openssl
19+ # make some edits…
1820$ pkg build
19- brewkit: building zlib.net
21+ brewkit: building openssl.org
2022```
2123
2224You can build for Linux (via Docker) using ` -L ` , e.g.:
@@ -32,7 +34,7 @@ Outside a pantry checkout we operate against your `pkgx` installation
3234than local to your pantry checkout.
3335
3436``` sh
35- pkgx +brewkit pkg build zlib.net
37+ env " $( pkgx +brewkit) " pkg build zlib.net
3638```
3739
3840
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
4- set -e
5-
64PKGX_DIR=${PKGX_DIR:-"$HOME/.pkgx"}
75
86if pwd | grep -q ' '; then
@@ -27,14 +25,14 @@ if test -z "$1"; then
2725 fi
2826 done
2927else
30- PKGS="$* "
28+ PKGS="$(find.ts $@) "
3129fi
3230
3331if test -n "$PKGX_DOCKER"; then
3432 exec "$d"/bin/pkg-docker build "$PKGS"
3533fi
3634
37- if ! available.ts "$@ "; then
35+ if ! available.ts "$PKGS "; then
3836 echo "warning: not supported on current platform" >&2
3937 exit 0
4038fi
@@ -53,7 +51,7 @@ PKGS="$(sort.ts $PKGS --delimiter ' ')"
5351# ^^ ensures that pkgs build topologically
5452
5553gum() {
56- pkgx gum format -- "$@ "
54+ pkgx gum format -- "$PKGS "
5755}
5856
5957for PKG in $PKGS; do
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
4- set -e
5-
64d="$(cd "$(dirname "$0")"/.. && pwd)"
75PATH="$d/libexec:$PATH"
86
@@ -17,7 +15,7 @@ if test -z "$1"; then
1715 fi
1816 done
1917else
20- PKGS="$1 "
18+ PKGS="$(find.ts $@) "
2119fi
2220
2321if test -z "$GITHUB_TOKEN"; then
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
44set -e
@@ -17,9 +17,8 @@ if test -z "$1"; then
1717 PKGS="$(GIT_WORK_TREE="$x" peek.sh --print-paths)"
1818 fi
1919 done
20- elif ! PKGS="$(find.ts $1)"; then
21- echo "error: \`$1\` not found in \`\$PKGX_PANTRY_PATH\`" >&2
22- exit 1
20+ else
21+ PKGS="$(_PATHS=1 find.ts $1)"
2322fi
2423
2524if test -z "$EDITOR"; then
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
4- set -e
5-
64d="$(cd "$(dirname "$0")"/.. && pwd)"
75PATH="$d/libexec:$PATH"
86
@@ -30,7 +28,7 @@ if test -z "$1"; then
3028 fi
3129 done
3230else
33- PKGS="$1 "
31+ PKGS="$(find.ts $1) "
3432fi
3533
3634if test -z "$GITHUB_TOKEN"; then
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
4- set -e
5-
64d="$(cd "$(dirname "$0")"/.. && pwd)"
75PATH="$d/libexec:$PATH"
86
@@ -17,7 +15,7 @@ if test -z "$1"; then
1715 fi
1816 done
1917else
20- PKGS="$1 "
18+ PKGS="$(find.ts $1) "
2119fi
2220
2321for PKG in $PKGS; do
Original file line number Diff line number Diff line change 1- #!/usr/bin/env -S pkgx bash
1+ #!/usr/bin/env -S pkgx bash -eo pipefail
22# shellcheck shell=bash
33
4- set -e
5-
64d="$(cd "$(dirname "$0")"/.. && pwd)"
75PATH="$d/libexec:$PATH"
86
@@ -17,7 +15,7 @@ if test -z "$1"; then
1715 fi
1816 done
1917else
20- PKGS="$* "
18+ PKGS="$(find.ts "$@") "
2119fi
2220
2321if test -n "$PKGX_DOCKER"; then
Original file line number Diff line number Diff line change 1- #!// usr/bin/env -S pkgx deno run --allow-read --allow-env
1+ #!/usr/bin/env -S pkgx deno run --allow-read --allow-env
22
33import { hooks } from "pkgx"
4- const { usePantry } = hooks
4+ const { find } = hooks . usePantry ( )
55
6- const pantry = usePantry ( )
7- const arg = Deno . args [ 0 ]
6+ for ( const arg of Deno . args ) {
7+ const rv = await find ( arg )
88
9- for await ( const entry of pantry . ls ( ) ) {
10- if ( entry . project === arg ) {
11- console . info ( entry . path . string )
12- Deno . exit ( 0 )
9+ if ( rv . length > 1 ) {
10+ console . error ( "multiple matches: " + rv . map ( ( { project} ) => project ) . join ( ' ' ) )
11+ Deno . exit ( 1 )
1312 }
14- if ( ( await pantry . project ( entry ) . provides ( ) ) . includes ( arg ) ) {
15- console . info ( entry . path . string )
16- Deno . exit ( 0 )
13+ if ( rv . length == 0 ) {
14+ console . error ( "no matches for: " + arg )
15+ Deno . exit ( 2 )
1716 }
18- }
1917
20- Deno . exit ( 1 )
18+ if ( Deno . env . get ( "_PATHS" ) ) {
19+ console . info ( rv [ 0 ] . path . string )
20+ } else {
21+ console . info ( rv [ 0 ] . project )
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments