File tree Expand file tree Collapse file tree
packages/workshop-cli/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -881,7 +881,14 @@ export async function cleanup({
881881 // explicit `--workshops` were provided, we treat the current workshop
882882 // as the only workshop candidate. This avoids suggesting other
883883 // workshops in prompts and keeps size estimates accurate.
884- allWorkshops = [ workshopFromCwd ]
884+ updateSpinner ( analysisSpinner , 'Resolving current workshop...' )
885+ const repoWorkshops = await listWorkshopsInDirectory ( reposDir )
886+ const matchingRepoWorkshop = repoWorkshops . find (
887+ ( workshop ) => workshop . repoName === workshopFromCwd . repoName ,
888+ )
889+ // Prefer the repos-directory path when available so workshop IDs are
890+ // stable even when cwd uses an equivalent symlinked path.
891+ allWorkshops = [ matchingRepoWorkshop ?? workshopFromCwd ]
885892 } else {
886893 updateSpinner ( analysisSpinner , 'Finding installed workshops...' )
887894 allWorkshops = await listWorkshopsInDirectory ( reposDir )
@@ -908,6 +915,13 @@ export async function cleanup({
908915 contextWorkshop =
909916 workshopIdentities . find ( ( workshop ) => workshop . id === cwdId ) ?? null
910917 }
918+ if (
919+ ! contextWorkshop &&
920+ shouldScopeToCwdWorkshop &&
921+ workshopIdentities . length === 1
922+ ) {
923+ contextWorkshop = workshopIdentities [ 0 ]
924+ }
911925 }
912926
913927 if ( selectedTargets . length === 0 ) {
You can’t perform that action at this time.
0 commit comments