File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { clone } from '../git'
22import { parseCliOptionsToGitArgs } from '../args'
33import { PluginApi } from '../types'
4+ import { readConfig } from '../config'
45
56export const get : PluginApi = {
67 extend ( api ) {
78 api . cli
89 . command ( 'get [repo]' , 'Clone/sync with a remote repository' )
910 . alias ( 'clone' )
10- . option ( '--shallow' , 'Shallow clone, alias to `--depth 1`' )
11+ . option ( '--shallow' , 'Shallow clone, alias to `--depth 1`' , {
12+ default : false ,
13+ type : [ Boolean ] ,
14+ } )
1115 . example ( 'ghq get 2nthony/ghq' )
1216 . example ( 'ghq get github.com/2nthony/ghq' )
1317 . example ( 'ghq get https://github.com/2nthony/ghq' )
1418 . example ( 'ghq clone 2nthony/ghq' )
1519 . allowUnknownOptions ( )
16- . action ( ( repo , options ) => {
20+ . action ( async ( repo , options ) => {
1721 if ( ! repo ) {
1822 api . cli . outputHelp ( )
1923 return
2024 }
2125
22- const args = parseCliOptionsToGitArgs ( options )
26+ const config = await readConfig ( )
27+ const args = parseCliOptionsToGitArgs ( { ...config , ...options } )
2328
2429 clone ( repo , ...args )
2530 } )
You can’t perform that action at this time.
0 commit comments