@@ -15,6 +15,7 @@ export interface Resolved_Local_Repo {
1515 repo_name : string ;
1616 repo_dir : string ;
1717 repo_url : string ;
18+ repo_git_ssh_url : string ;
1819 repo_config : Gitops_Repo_Config ;
1920 pkg : Package_Meta ;
2021 // TODO what else? filesystem info?
@@ -24,6 +25,7 @@ export interface Unresolved_Local_Repo {
2425 type : 'unresolved_local_repo' ;
2526 repo_name : string ;
2627 repo_url : string ;
28+ repo_git_ssh_url : string ;
2729 repo_config : Gitops_Repo_Config ;
2830}
2931
@@ -35,9 +37,11 @@ export const resolve_local_repo = async (
3537 const repo_name = strip_end ( repo_url , '/' ) . split ( '/' ) . at ( - 1 ) ;
3638 if ( ! repo_name ) throw Error ( 'Invalid `repo_config.repo_url` ' + repo_url ) ;
3739
40+ const repo_git_ssh_url = to_repo_git_ssh_url ( repo_url ) ;
41+
3842 const repo_dir = repo_config . repo_dir ?? join ( repos_dir , repo_name ) ;
3943 if ( ! existsSync ( repo_dir ) ) {
40- return { type : 'unresolved_local_repo' , repo_name, repo_url, repo_config} ;
44+ return { type : 'unresolved_local_repo' , repo_name, repo_url, repo_git_ssh_url , repo_config} ;
4145 }
4246
4347 const parsed_sveltekit_config = await init_sveltekit_config ( repo_dir ) ;
@@ -51,7 +55,13 @@ export const resolve_local_repo = async (
5155 repo_name,
5256 repo_dir,
5357 repo_url,
58+ repo_git_ssh_url,
5459 repo_config,
5560 pkg : parse_package_meta ( package_json , src_json ) ,
5661 } ;
5762} ;
63+
64+ const to_repo_git_ssh_url = ( repo_url : string ) : string => {
65+ const url = new URL ( repo_url ) ;
66+ return `git@${ url . hostname } :${ url . pathname . substring ( 1 ) } ` ;
67+ } ;
0 commit comments