Skip to content

Commit

Permalink
Fix never using git for the pantry overlay step
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed May 2, 2023
1 parent ba3be69 commit 31c2fc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</p>


# tea/cli 0.31.1
# tea/cli 0.31.2

`tea` puts the whole open source ecosystem at your fingertips:

Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export default async function() {
async function git(...args: (string | Path)[]) {
const pkg = await useCellar().has({ project: 'git-scm.org', constraint: new semver.Range('*') })
const git = (pkg?.path ?? usr())?.join("bin/git")
if (git) await run({cmd: [git, ...args]})
throw new Error("no-git") // caught above to trigger http download instead
if (!git) throw new Error("no-git") // caught above to trigger http download instead
await run({cmd: [git, ...args]})

function usr() {
// only return /usr/bin if in the PATH so user can explicitly override this
Expand All @@ -64,7 +64,7 @@ async function git(...args: (string | Path)[]) {
if (host().platform == 'darwin') {
if (new Path("/Library/Developer/CommandLineTools/usr/bin/git").isExecutableFile()) return rv
if (new Path("/Application/Xcode.app").isDirectory()) return rv
return
return // don’t use `git`
}

return rv
Expand Down

0 comments on commit 31c2fc0

Please sign in to comment.