From 29a42ba5d182fa6d7410da6fac87327b293618c2 Mon Sep 17 00:00:00 2001 From: Tobias Bocanegra Date: Wed, 18 Oct 2023 13:20:55 +0200 Subject: [PATCH] fix: ensure proper env prefix (#2260) fixes #2259 --- src/cli.js | 2 +- test/fixtures/all.env | 4 ++++ test/up-cli.test.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index b6899b9c6..8213d260f 100755 --- a/src/cli.js +++ b/src/cli.js @@ -121,7 +121,7 @@ export default class CLI { .scriptName('aem') .usage('Usage: $0 [options]') .parserConfiguration({ 'camel-case-expansion': false }) - .env('AEM') + .env('AEM_') .check((a) => envAwareStrict(a, argv.parsed.aliases)) .showHelpOnFail(true) .fail(this._failFn) diff --git a/test/fixtures/all.env b/test/fixtures/all.env index 985d73608..1129079ea 100644 --- a/test/fixtures/all.env +++ b/test/fixtures/all.env @@ -1,6 +1,9 @@ # # env file for testing that contains all possible and impossible values # +# ignored +AEMCOMPANIONPATH=foobar +AEM_COMPANIONPATH=foobar # global AEM_LOG_LEVEL=debug @@ -13,6 +16,7 @@ AEM_TARGET=foo AEM_FILES=*.htl,*.js # up +AEM_PRINT_INDEX=true AEM_HOST=www.project-helix.io AEM_OPEN=false AEM_LIVERELOAD=false diff --git a/test/up-cli.test.js b/test/up-cli.test.js index ea4b17efc..5f7ea8e8c 100644 --- a/test/up-cli.test.js +++ b/test/up-cli.test.js @@ -70,6 +70,7 @@ describe('hlx up', () => { sinon.assert.calledWith(mockUp.withLiveReload, false); sinon.assert.calledWith(mockUp.withHttpPort, 1234); sinon.assert.calledWith(mockUp.withBindAddr, '*'); + sinon.assert.calledWith(mockUp.withPrintIndex, true); sinon.assert.calledOnce(mockUp.run); });