@salesforce/cli 2.114.5-dev.1 → 2.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,7 @@ $ npm install -g @salesforce/cli
25
25
  $ sf COMMAND
26
26
  running command...
27
27
  $ sf (--version|-v)
28
- @salesforce/cli/2.114.5-dev.1 linux-x64 node-v22.21.1
28
+ @salesforce/cli/2.115.0 linux-x64 node-v22.21.1
29
29
  $ sf --help [COMMAND]
30
30
  USAGE
31
31
  $ sf COMMAND
@@ -71,7 +71,24 @@ const hook = async function ({ argv, options, context }) {
71
71
  return [name, undefined];
72
72
  }
73
73
  const crlf = contents.search('\r\n') !== -1;
74
- const values = ext === '.json' ? [JSON.stringify(JSON.parse(contents))] : contents?.trim().split(crlf ? '\r\n' : '\n');
74
+ let values;
75
+ if (ext === '.json') {
76
+ // JSON files: parse and re-stringify (existing behavior)
77
+ values = [JSON.stringify(JSON.parse(contents))];
78
+ }
79
+ else {
80
+ // Non-JSON files: split by lines and filter full-line comments
81
+ const lines = contents?.trim().split(crlf ? '\r\n' : '\n') || [];
82
+ values = lines.filter((line) => {
83
+ const trimmed = line.trim();
84
+ // Filter out lines that are only whitespace + comment (full-line comments)
85
+ if (trimmed.startsWith('#') || trimmed.startsWith('//')) {
86
+ return false;
87
+ }
88
+ // Keep all other lines unchanged, including empty lines
89
+ return true;
90
+ });
91
+ }
75
92
  return [name, values];
76
93
  }));
77
94
  const newArgv = [...argv];