Skip to content

Commit 6051b22

Browse files
author
Lukas Holzer
authored
feat: let the --cwd option override the monorepo execution directory (#5950)
1 parent d7bbbd2 commit 6051b22

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/base-command.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ export default class BaseCommand extends Command {
574574
// configuration file and the API
575575
// ==================================================
576576
const cachedConfig = await actionCommand.getConfig({
577-
cwd: this.jsWorkspaceRoot || this.workingDir,
577+
cwd: flags.cwd ? this.workingDir : this.jsWorkspaceRoot || this.workingDir,
578578
repositoryRoot: rootDir,
579579
packagePath: this.workspacePackage,
580580
// The config flag needs to be resolved from the actual process working directory

src/utils/run-build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const runNetlifyBuild = async ({ command, env = {}, options, settings, ti
8080
const devCommand = async (settingsOverrides = {}) => {
8181
let cwd = command.workingDir
8282

83-
if (command.project.workspace?.packages.length) {
83+
if (!options.cwd && command.project.workspace?.packages.length) {
8484
cwd = join(command.project.jsWorkspaceRoot, settings.baseDirectory || '')
8585
}
8686

0 commit comments

Comments
 (0)