File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616</p >
1717
1818
19- # tea/cli 0.31.0
19+ # tea/cli 0.31.1
2020
2121` tea ` puts the whole open source ecosystem at your fingertips:
2222
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import useRun, { RunOptions } from "./useRun.ts"
33import useLogger from "./useLogger.ts"
44import * as semver from "semver"
55import Path from "path"
6+ import { host } from "../utils/index.ts" ;
67
78export default async function ( ) {
89 const logger = useLogger ( )
@@ -52,10 +53,21 @@ async function git(...args: (string | Path)[]) {
5253 const pkg = await useCellar ( ) . has ( { project : 'git-scm.org' , constraint : new semver . Range ( '*' ) } )
5354 const git = ( pkg ?. path ?? usr ( ) ) ?. join ( "bin/git" )
5455 if ( git ) await run ( { cmd : [ git , ...args ] } )
56+ throw new Error ( "no-git" ) // caught above to trigger http download instead
5557
5658 function usr ( ) {
5759 // only return /usr/bin if in the PATH so user can explicitly override this
58- return Deno . env . get ( "PATH" ) ?. split ( ":" ) ?. includes ( "/usr/bin" ) ? new Path ( "/usr" ) : undefined
60+ const rv = Deno . env . get ( "PATH" ) ?. split ( ":" ) ?. includes ( "/usr/bin" ) ? new Path ( "/usr" ) : undefined
61+
62+ /// don’t cause macOS to abort and then prompt the user to install the XcodeCLT
63+ //FIXME test! but this is hard to test without docker images or something!
64+ if ( host ( ) . platform == 'darwin' ) {
65+ if ( new Path ( "/Library/Developer/CommandLineTools/usr/bin/git" ) . isExecutableFile ( ) ) return rv
66+ if ( new Path ( "/Application/Xcode.app" ) . isDirectory ( ) ) return rv
67+ return
68+ }
69+
70+ return rv
5971 }
6072}
6173
You can’t perform that action at this time.
0 commit comments