Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/commands/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,21 @@ export default class BaseCommand extends Command {
private async init(actionCommand: BaseCommand) {
debug(`${actionCommand.name()}:init`)('start')
const flags = actionCommand.opts()

// here we actually want to use the process.cwd as we are setting the workingDir
// eslint-disable-next-line no-restricted-properties
this.workingDir = flags.cwd ? resolve(flags.cwd) : process.cwd()
const processCwd = process.cwd()

if (flags.cwd) {
const resolvedCwd = resolve(flags.cwd)
this.workingDir = resolvedCwd

// if cwd matches process.cwd, act like cwd wasn't provided
if (resolvedCwd === processCwd) {
delete flags.cwd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the main change? I'm kinda confused on what behavior has changed because it seems like we're still resolving to the cwd from the flag or process.cwd()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Down the process it is being check

!flags.cwd &&

this.workingDir = processCwd
}
}

// ==================================================
// Create a Project and run the Heuristics to detect
Expand Down
Loading