Skip to content

Commit

Permalink
There’s just teaxyz/pantry now
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Mar 19, 2023
1 parent e6acb2b commit aeaf3c5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ sh <(curl https://tea.xyz)
```

Our one-liner sets up in `~/.tea` and enables magic but it actually can do a
whole bunch more. For all the deets and other ways to install check out
the manual [docs.tea.xyz].
whole bunch more. For all the deets and other ways to install (including [our
GitHub Action]) check out the manual [docs.tea.xyz].

&nbsp;

Expand Down Expand Up @@ -219,9 +219,10 @@ deno task install # deploys the local checkout into your `~/.tea`


[docs.tea.xyz]: https://docs.tea.xyz
[pantry]: https://github.com/teaxyz/pantry.core
[pantry]: https://github.com/teaxyz/pantry
[deno]: https://deno.land
[TypeScript]: https://www.typescriptlang.org
[discussion]: https://github.com/orgs/teaxyz/discussions
[stable-diffusion-webui]: https://github.com/AUTOMATIC1111/stable-diffusion-webui
[releases]: ../../releases
[our GitHub Action]: https://github.com/teaxyz/setup
2 changes: 1 addition & 1 deletion src/hooks/useErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function msg(err: TeaError): string {
msg = undent`
pantry entry invalid. please report this bug!
https://github.com/teaxyz/pantry.core/issues/new
https://github.com/teaxyz/pantry/issues/new
----------------------------------------------------->> attachment begin
${logger.gray(attachment)}
Expand Down
43 changes: 20 additions & 23 deletions src/hooks/useSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,41 +93,38 @@ export async function install(logger: Logger): Promise<true | 'not-git' | 'noop'
}

async function clone(git: Path) {
const pp: Promise<void>[] = []
for (const name of ["pantry.core", "pantry.extra"]) {
const p = run({
cmd: [
git, "clone",
"--bare", "--depth=1",
`https://github.com/teaxyz/${name}`,
pantries_dir.join("teaxyz").mkpath().join(name)
]
})
pp.push(p)
}

await Promise.all(pp)
await run({
cmd: [
git, "clone",
"--bare", "--depth=1",
`https://github.com/teaxyz/pantry`,
pantries_dir.join("teaxyz").mkpath().join("pantry")
]
})
await co(git)
}

async function unzip() {
//FIXME if we do this, we need to be able to convert it to a git installation later
//TODO use our tar if necessary
//TODO if we keep this then don’t store the files, just pipe to tar
for (const name of ["pantry.core", "pantry.extra"]) {
const src = new URL(`https://github.com/teaxyz/${name}/archive/refs/heads/main.tar.gz`)
const tgz = await useDownload().download({ src })
const cwd = pantry_dir.mkpath()
await run({cmd: ["tar", "xzf", tgz, "--strip-components=1"], cwd })
}
const src = new URL(`https://github.com/teaxyz/pantry/archive/refs/heads/main.tar.gz`)
const tgz = await useDownload().download({ src })
const cwd = pantry_dir.mkpath()
await run({cmd: ["tar", "xzf", tgz, "--strip-components=1"], cwd })
}
}

async function *ls() {
for await (const [user, {isDirectory}] of pantries_dir.ls()) {
for await (const [user, {isDirectory, name: user_name}] of pantries_dir.ls()) {
if (!isDirectory) continue
for await (const [repo, isDirectory] of user.ls()) {
if (isDirectory) yield repo
for await (const [repo, {isDirectory, name: repo_name}] of user.ls()) {
if (!isDirectory) continue
if (user_name == "teaxyz" && repo_name == "pantry.core") {
// we used to have multiple pantries, but not anymore!
continue
}
yield repo
}}
}

Expand Down
8 changes: 4 additions & 4 deletions src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class TeaError extends Error {
msg = undent`
couldn’t find a pkg to provide: \`${ctx.arg0}'
https://github.com/teaxyz/pantry.extra#contributing
https://github.com/teaxyz/pantry#contributing
`
break
Expand Down Expand Up @@ -88,14 +88,14 @@ export default class TeaError extends Error {
msg = undent`
Not in pantry: ${ctx.project}
https://github.com/teaxyz/pantry.extra#contributing
https://github.com/teaxyz/pantry#contributing
`
break
case 'parser: pantry: package.yml':
msg = undent`
pantry entry invalid. please report this bug!
https://github.com/teaxyz/pantry.core/issues/new
https://github.com/teaxyz/pantry/issues/new
----------------------------------------------------->> attachment begin
${ctx.project}: ${ctx.cause?.message}
Expand Down Expand Up @@ -125,7 +125,7 @@ export default class TeaError extends Error {
msg = undent`
we haven’t packaged ${str}. but we will… *if* you open a ticket:
https://github.com/teaxyz/pantry.core/issues/new
https://github.com/teaxyz/pantry/issues/new
`
} break
case 'confused: interpreter':
Expand Down

0 comments on commit aeaf3c5

Please sign in to comment.