File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -500,9 +500,21 @@ export default class BaseCommand extends Command {
500500 private async init ( actionCommand : BaseCommand ) {
501501 debug ( `${ actionCommand . name ( ) } :init` ) ( 'start' )
502502 const flags = actionCommand . opts ( )
503+
503504 // here we actually want to use the process.cwd as we are setting the workingDir
504505 // eslint-disable-next-line no-restricted-properties
505- this . workingDir = flags . cwd ? resolve ( flags . cwd ) : process . cwd ( )
506+ const processCwd = process . cwd ( )
507+
508+ if ( flags . cwd ) {
509+ const resolvedCwd = resolve ( flags . cwd )
510+ this . workingDir = resolvedCwd
511+
512+ // if cwd matches process.cwd, act like cwd wasn't provided
513+ if ( resolvedCwd === processCwd ) {
514+ delete flags . cwd
515+ this . workingDir = processCwd
516+ }
517+ }
506518
507519 // ==================================================
508520 // Create a Project and run the Heuristics to detect
You can’t perform that action at this time.
0 commit comments