File tree Expand file tree Collapse file tree
apps/client-with-vite/src/lib/smartbar Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,10 +45,12 @@ export const SmartBarFeatures = [
4545 } ,
4646 icon : GitBranch ,
4747 placeholder : 'Git repository URL to clone' ,
48- match : ( input : string ) => GIT_REPO_REGEX . test ( input . trim ( ) ) || GIT_CLONE_PREFIX_REGEX . test ( input . trim ( ) ) ,
48+ match : ( input : string ) =>
49+ GIT_REPO_REGEX . test ( input . trim ( ) . split ( ' ' ) [ 0 ] ) || //
50+ GIT_CLONE_PREFIX_REGEX . test ( input . trim ( ) ) ,
4951 action : async ( input : string ) => {
50- const repoUrl = input . trim ( ) . replace ( GIT_CLONE_PREFIX_REGEX , '' ) ;
51- const repoName = repoUrl . split ( '/' ) . pop ( ) ?. replace ( '.git' , '' ) || 'cloned-repo' ;
52+ const [ repoUrl , folder ] = input . trim ( ) . replace ( GIT_CLONE_PREFIX_REGEX , '' ) . split ( ' ') ;
53+ const repoName = folder || repoUrl . split ( '/' ) . pop ( ) ?. replace ( '.git' , '' ) || 'cloned-repo' ;
5254 const cloneCommand = `
5355 REPO_NAME="${ repoName } "
5456 COUNTER=0
You can’t perform that action at this time.
0 commit comments