From d2fbff2d3ec8c5909f95304935576fe59594d7f0 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Fri, 6 Sep 2024 20:27:19 +0200 Subject: [PATCH 1/4] Fix typo --- win32/build/confutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 2f333668d4552..3d589dc143f14 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2096,7 +2096,7 @@ function generate_files() if (INVALID_CONFIG_ARGS.length) { STDOUT.WriteLine('WARNING'); - STDOUT.WriteLine('The following arguments is invalid, and therefore ignored:'); + STDOUT.WriteLine('The following arguments are invalid, and therefore ignored:'); for (var i = 0; i < INVALID_CONFIG_ARGS.length; ++i) { STDOUT.WriteLine(' ' + INVALID_CONFIG_ARGS[i]); From 02b1ca214e185145280da490255d4556f00cc25c Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Fri, 6 Sep 2024 20:51:21 +0200 Subject: [PATCH 2/4] Implement conditional message --- win32/build/confutils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3d589dc143f14..560d49cc14935 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2096,7 +2096,11 @@ function generate_files() if (INVALID_CONFIG_ARGS.length) { STDOUT.WriteLine('WARNING'); - STDOUT.WriteLine('The following arguments are invalid, and therefore ignored:'); + if (INVALID_CONFIG_ARGS.length > 1) { + STDOUT.WriteLine('The following arguments are invalid, and therefore ignored:'); + } else { + STDOUT.WriteLine('The following argument is invalid, and therefore ignored:'); + } for (var i = 0; i < INVALID_CONFIG_ARGS.length; ++i) { STDOUT.WriteLine(' ' + INVALID_CONFIG_ARGS[i]); From 1985436e48fe39368cd5956322c84e60e3d473ce Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 7 Sep 2024 09:47:55 +0200 Subject: [PATCH 3/4] Use suggested code with ternary --- win32/build/confutils.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 560d49cc14935..50e80d3a017ab 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2096,11 +2096,9 @@ function generate_files() if (INVALID_CONFIG_ARGS.length) { STDOUT.WriteLine('WARNING'); - if (INVALID_CONFIG_ARGS.length > 1) { - STDOUT.WriteLine('The following arguments are invalid, and therefore ignored:'); - } else { - STDOUT.WriteLine('The following argument is invalid, and therefore ignored:'); - } + STDOUT.WriteLine('The following ' + + INVALID_CONFIG_ARGS.length > 1 ? 'arguments are' : 'argument is' + + ' invalid, and therefore ignored:'); for (var i = 0; i < INVALID_CONFIG_ARGS.length; ++i) { STDOUT.WriteLine(' ' + INVALID_CONFIG_ARGS[i]); From 04241debb9de6769af3be02f4f70cd728c25e6f5 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 7 Sep 2024 14:44:54 +0200 Subject: [PATCH 4/4] Wrap ternary Co-authored-by: Peter Kokot --- win32/build/confutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 50e80d3a017ab..5a28719f31bd9 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2097,7 +2097,7 @@ function generate_files() if (INVALID_CONFIG_ARGS.length) { STDOUT.WriteLine('WARNING'); STDOUT.WriteLine('The following ' + - INVALID_CONFIG_ARGS.length > 1 ? 'arguments are' : 'argument is' + + (INVALID_CONFIG_ARGS.length > 1 ? 'arguments are' : 'argument is') + ' invalid, and therefore ignored:'); for (var i = 0; i < INVALID_CONFIG_ARGS.length; ++i) {