@@ -9,6 +9,14 @@ type PositionalRepo = {
99 readonly restArgs : ReadonlyArray < string >
1010}
1111
12+ export const resolveWorkspaceRepoPath = (
13+ resolvedRepo : ReturnType < typeof resolveRepoInput >
14+ ) : string => {
15+ const baseParts = deriveRepoPathParts ( resolvedRepo . repoUrl ) . pathParts
16+ const projectParts = resolvedRepo . workspaceSuffix ? [ ...baseParts , resolvedRepo . workspaceSuffix ] : baseParts
17+ return projectParts . join ( "/" )
18+ }
19+
1220export const splitPositionalRepo = ( args : ReadonlyArray < string > ) : PositionalRepo => {
1321 const first = args [ 0 ]
1422 const positionalRepoUrl = first !== undefined && ! first . startsWith ( "-" ) ? first : undefined
@@ -24,16 +32,7 @@ export const parseProjectDirWithOptions = (
2432 const { positionalRepoUrl, restArgs } = splitPositionalRepo ( args )
2533 const raw = yield * _ ( parseRawOptions ( restArgs ) )
2634 const rawRepoUrl = raw . repoUrl ?? positionalRepoUrl
27- const resolvedRepo = rawRepoUrl ? resolveRepoInput ( rawRepoUrl ) : null
28- const repoPath = resolvedRepo
29- ? ( ( ) => {
30- const baseParts = deriveRepoPathParts ( resolvedRepo . repoUrl ) . pathParts
31- const projectParts = resolvedRepo . workspaceSuffix
32- ? [ ...baseParts , resolvedRepo . workspaceSuffix ]
33- : baseParts
34- return projectParts . join ( "/" )
35- } ) ( )
36- : null
35+ const repoPath = rawRepoUrl ? resolveWorkspaceRepoPath ( resolveRepoInput ( rawRepoUrl ) ) : null
3736 const projectDir = raw . projectDir ??
3837 ( repoPath
3938 ? `.docker-git/${ repoPath } `
0 commit comments