Skip to content

Commit

Permalink
k, so we do want to swallow, but throw when building (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jul 8, 2022
1 parent 4752ad6 commit 3fdf2a4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .github/mk-pantry-accessible.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

git config --global url."https://teaxyz:$1@github.com/teaxyz/pantry".insteadOf "https://github.com/teaxyz/pantry"
7 changes: 3 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
commence: ${{ steps.rev-parse.outputs.result == 'commence' }}
steps:
- uses: actions/checkout@v3
- uses: teaxyz/setup@v0

#TMP until we go public
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.PK }}
- run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}

- uses: teaxyz/setup@v0

- id: extract
name: determine current version
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ jobs:
VERBOSE: 1
TEA_SECRET: ${{ secrets.TEA_SECRET }}
steps:
- uses: actions/checkout@v3

#TMP until we go public
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.PK }}
- run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}

- uses: actions/checkout@v3
- uses: teaxyz/setup@v0
- run: ./scripts/test.sh
env:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Change how your team works.
 


# tea/cli 0.3.0
# tea/cli 0.3.1

tea is a universal virtual‑environment manager:

Expand Down Expand Up @@ -528,7 +528,7 @@ If you got this error message, you need to install tea:
| Project | Version | Lock |
|-------------|---------|--------|
| deno.land | ^1.18 | 1.20.3 |
| tea.xyz | ^0 | 0.3.0 |
| tea.xyz | ^0 | 0.3.1 |
[pantry]: ../../../../pantry
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/usePantry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async function installIfNecessary() {
const cwd = prefix.parent().parent().mkpath()
//FIXME before release, use https://
await run({
cmd: ["git", "clone", "git@github.com:teaxyz/pantry.git"],
cmd: ["git", "clone", "https://github.com/teaxyz/pantry"],
cwd
})
}
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useShellEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export default async function useShellEnv(requirements: PackageRequirement[]): P
const pending: PackageRequirement[] = []

for (const requirement of requirements) {
const installation = await cellar.resolve(requirement)
const installation = await cellar.resolve(requirement).swallow(/^not-found:/)

if (!installation) {
pending.push(requirement)
} else for (const key of EnvKeys)
} else for (const key of EnvKeys) {
for (const suffix of suffixes(key)!) {
if (!vars[key]) vars[key] = []
vars[key].compactUnshift(installation.path.join(suffix).compact()?.string)
Expand All @@ -37,6 +37,7 @@ export default async function useShellEnv(requirements: PackageRequirement[]): P
vars.LIBRARY_PATH.compactUnshift(installation.path.join("lib").compact()?.string)
vars.CPATH.compactUnshift(installation.path.join("include").compact()?.string)
}
}
}

const defaults: Env = {}
Expand Down
4 changes: 4 additions & 0 deletions src/prefab/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default async function build({ pkg, deps }: Options): Promise<Path> {
const sh = await pantry.getBuildScript(pkg)
const { platform } = usePlatform()

if (env.pending.length) {
throw {uninstalled: env.pending}
}

/// FIXME: no one likes this. `set -o pipefail` is the reason for this requirement.
const shell = platform === "linux" ? "bash" : "sh"

Expand Down

0 comments on commit 3fdf2a4

Please sign in to comment.