From 13af82f292ccf3f25ad086ec68c1153bdc561ea0 Mon Sep 17 00:00:00 2001 From: sbeesm Date: Tue, 23 Jan 2024 15:47:19 +0530 Subject: [PATCH] fix: Remove path normalization at arg parser level; now handled in cmd/run.js --- src/program.js | 2 +- tests/unit/test.program.js | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/program.js b/src/program.js index 35d794a912..a090e29158 100644 --- a/src/program.js +++ b/src/program.js @@ -430,7 +430,7 @@ Example: $0 --help run. default: process.cwd(), requiresArg: true, type: 'string', - coerce: (arg) => (arg != null ? path.resolve(arg) : undefined), + coerce: (arg) => arg ?? undefined, }, 'artifacts-dir': { alias: 'a', diff --git a/tests/unit/test.program.js b/tests/unit/test.program.js index e70508f559..ab41ccbb5b 100644 --- a/tests/unit/test.program.js +++ b/tests/unit/test.program.js @@ -481,19 +481,6 @@ describe('program.main', () => { sinon.assert.calledWith(fakeVersionGetter, projectRoot); }); - it('turns sourceDir into an absolute path', () => { - const fakeCommands = fake(commands, { - build: () => Promise.resolve(), - }); - return execProgram(['build', '--source-dir', '..'], { - commands: fakeCommands, - }).then(() => { - sinon.assert.calledWithMatch(fakeCommands.build, { - sourceDir: path.resolve(path.join(process.cwd(), '..')), - }); - }); - }); - it('normalizes the artifactsDir path', () => { const fakeCommands = fake(commands, { build: () => Promise.resolve(),