Skip to content

Commit 6727b8f

Browse files
authored
Merge pull request #241 from forcedotcom/release-1.7.0
RELEASE @W-18394670@ Conducting v1.7.0 release
2 parents 38e35a1 + a0c1498 commit 6727b8f

File tree

12 files changed

+1720
-730
lines changed

12 files changed

+1720
-730
lines changed

SHA256.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ make sure that their SHA values match the values in the list below.
1515
shasum -a 256 <location_of_the_downloaded_file>
1616

1717
3. Confirm that the SHA in your output matches the value in this list of SHAs.
18-
fc2d37a4f1c59206be01f30ff9384ec202632b7bb8d95b4776c4d75469377ff4 ./extensions/sfdx-code-analyzer-vscode-1.6.0.vsix
18+
be09cbce3b4897ea3bad5a1bdffbf15835a6382d6e771ac595bec6230485f6c6 ./extensions/sfdx-code-analyzer-vscode-1.6.1.vsix
1919
4. Change the filename extension for the file that you downloaded from .zip to
2020
.vsix.
2121

package-lock.json

Lines changed: 1688 additions & 705 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"color": "#ECECEC",
1414
"theme": "light"
1515
},
16-
"version": "1.6.1",
16+
"version": "1.7.0",
1717
"publisher": "salesforce",
1818
"license": "BSD-3-Clause",
1919
"engines": {

src/lib/cli-commands.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export interface CliCommandExecutor {
5858
exec(command: string, args: string[], options?: ExecOptions): Promise<CommandOutput>
5959
}
6060

61+
const IS_WINDOWS: boolean = process.platform.startsWith('win');
62+
6163
export class CliCommandExecutorImpl implements CliCommandExecutor {
6264
private readonly logger: Logger;
6365

@@ -104,12 +106,11 @@ export class CliCommandExecutorImpl implements CliCommandExecutor {
104106

105107
let childProcess: cp.ChildProcessWithoutNullStreams;
106108
try {
107-
childProcess = cp.spawn(command, args, {
108-
shell: process.platform.startsWith('win'), // Use shell on Windows machines
109-
});
109+
childProcess = IS_WINDOWS ? cp.spawn(command, wrapArgsWithSpacesWithQuotes(args), {shell: true}) :
110+
cp.spawn(command, args);
110111
} catch (err) {
111112
this.logger.logAtLevel(vscode.LogLevel.Error, `Failed to execute the following command:\n` +
112-
indent(`${command} ${args.map(arg => arg.includes(' ') ? `"${arg}"` : arg).join(' ')}`) + `\n\n` +
113+
indent(`${command} ${wrapArgsWithSpacesWithQuotes(args).join(' ')}`) + `\n\n` +
113114
'Error Thrown:\n' + indent(getErrorMessageWithStack(err)));
114115
output.stderr = getErrorMessageWithStack(err);
115116
output.exitCode = 127;
@@ -123,7 +124,7 @@ export class CliCommandExecutorImpl implements CliCommandExecutor {
123124
let combinedOut: string = '';
124125

125126
this.logger.logAtLevel(logLevel, `Executing with background process (${childProcess.pid}):\n` +
126-
indent(`${command} ${args.map(arg => arg.includes(' ') ? `"${arg}"` : arg).join(' ')}`));
127+
indent(`${command} ${wrapArgsWithSpacesWithQuotes(args).join(' ')}`));
127128

128129
childProcess.stdout.on('data', data => {
129130
output.stdout += data;
@@ -134,8 +135,10 @@ export class CliCommandExecutorImpl implements CliCommandExecutor {
134135
combinedOut += data;
135136
});
136137
childProcess.on('error', (err: Error) => {
138+
const errMsg: string = getErrorMessageWithStack(err);
137139
output.exitCode = 127; // 127 signifies that the command could not be executed
138-
output.stderr += getErrorMessageWithStack(err);
140+
output.stderr += errMsg;
141+
combinedOut += errMsg;
139142
resolve(output);
140143
this.logger.logAtLevel(logLevel,
141144
`Error from background process (${childProcess.pid}):\n${indent(combinedOut)}`);
@@ -149,3 +152,7 @@ export class CliCommandExecutorImpl implements CliCommandExecutor {
149152
});
150153
}
151154
}
155+
156+
function wrapArgsWithSpacesWithQuotes(args: string[]): string[] {
157+
return args.map(arg => arg.includes(' ') ? `"${arg}"` : arg);
158+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/test/legacy/extension.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ suite('Extension Test Suite', () => {
7070
});
7171

7272
suite('sfca.runOnActiveFile', () => {
73-
const fileUri: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder-a', 'MyClassA1.cls'));
73+
const fileUri: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder a', 'MyClassA1.cls'));
7474

7575
setup(async function() {
7676
// Open a file in the editor.
@@ -119,7 +119,7 @@ suite('Extension Test Suite', () => {
119119
suite('sfca.runOnSelected', () => {
120120
suite('One file selected', () => {
121121
// Get the URI for a single file.
122-
const targetUri: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder-a', 'MyClassA1.cls'));
122+
const targetUri: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder a', 'MyClassA1.cls'));
123123

124124
teardown(() => {
125125
Sinon.restore();
@@ -169,8 +169,8 @@ suite('Extension Test Suite', () => {
169169

170170
suite('Multiple files selected', () => {
171171
// Get the URIs for two separate files.
172-
const targetUri1: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder-a', 'MyClassA1.cls'));
173-
const targetUri2: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder-a', 'MyClassA2.cls'));
172+
const targetUri1: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder a', 'MyClassA1.cls'));
173+
const targetUri2: vscode.Uri = vscode.Uri.file(path.join(codeFixturesPath, 'folder a', 'MyClassA2.cls'));
174174

175175
teardown(() => {
176176
Sinon.restore();

0 commit comments

Comments
 (0)