Skip to content

Commit ff30a6a

Browse files
authored
Merge pull request #849 from oracle/release/24.2
merge release/24.2 into maser after vscode-extension v2.0.1 changes
2 parents bf3465b + fb656bb commit ff30a6a

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

packages/vscode-extension/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 2.0.1
4+
5+
- Fix for GitHub issue 841
6+
- Fix for privatekeypath
7+
38
## 2.0.0
49

510
- Upgrade to OAuth 2.0 authorization protocol

packages/vscode-extension/package-lock.json

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

packages/vscode-extension/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
"publisher": "Oracle",
1313
"license": "UPL-1.0",
1414
"private": true,
15-
"version": "2.0.0",
15+
"version": "2.0.1",
1616
"icon": "resources/extension_icon_dark.png",
1717
"repository": {
1818
"type": "git",
1919
"url": "git+https://github.com/oracle/netsuite-suitecloud-sdk.git",
2020
"directory": "packages/vscode-extension"
2121
},
22-
"files": [
23-
"**/*.vsix"
24-
],
2522
"engines": {
2623
"vscode": "^1.91.1"
2724
},

packages/vscode-extension/src/commands/CompareFile.ts

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { actionResultStatus, ApplicationConstants, ProjectInfoService } from '..
1414
import FileImportCommon from './FileImportCommon';
1515

1616
export default class CompareFile extends FileImportCommon {
17-
private static readonly ACCOUNT_COPY_BASE_NAME = 'accountCopy';
1817
private static readonly COMMAND_NAME = 'comparefile';
1918
private static readonly SCHEME = 'suitecloud';
2019
private static readonly TEMP_FOLDER_PREFIX = 'suitecloud-vscode-extension-compare-file-';
@@ -47,25 +46,26 @@ export default class CompareFile extends FileImportCommon {
4746

4847
protected async execute() {
4948
const activeFilePath = this.activeFile!;
50-
const tempFolderPath = fs.mkdtempSync(path.join(os.tmpdir(), CompareFile.TEMP_FOLDER_PREFIX));
51-
52-
this.copyManifestFileToTempFolder(tempFolderPath);
53-
this.copyProjectJsonToTempFolder(tempFolderPath);
49+
// create temp project folder to import file to be compared
50+
const tempProjectFolderPath = fs.mkdtempSync(path.join(os.tmpdir(), CompareFile.TEMP_FOLDER_PREFIX));
51+
// temp project prepartion to import file
52+
this.copyManifestFileToTempFolder(tempProjectFolderPath);
53+
this.copyProjectJsonToTempFolder(tempProjectFolderPath);
5454
const activeFileRelativePath = activeFilePath.split(this.getFileCabinetFolderPath())[1]?.replace(/\\/g, '/');
55-
const importFilePath = this.getImportFilePath(tempFolderPath, activeFilePath, activeFileRelativePath);
56-
57-
const selectedFilesPaths = [];
58-
selectedFilesPaths.push(activeFileRelativePath);
55+
const importFilePath = this.getImportFilePath(tempProjectFolderPath, activeFilePath, activeFileRelativePath);
5956

60-
const commandArgs = {
61-
paths: selectedFilesPaths,
57+
// file:import args preparation and trigger
58+
const fileImportArgs = {
59+
paths: [activeFileRelativePath],
6260
excludeproperties: 'true',
6361
calledfromcomparefiles: 'true',
6462
};
65-
66-
const commandActionPromise = this.runSuiteCloudCommand(commandArgs, tempFolderPath);
63+
const commandActionPromise = this.runSuiteCloudCommand(fileImportArgs, tempProjectFolderPath);
6764
this.messageService.showStatusBarMessage(this.translationService.getMessage(COMPARE_FILE.COMPARING_FILE), true, commandActionPromise);
65+
66+
// file:import result
6867
const actionResult = await commandActionPromise;
68+
6969
if (actionResult.status === actionResultStatus.SUCCESS && actionResult.data) {
7070
if (actionResult.data.results[0].loaded) {
7171
vscode.commands.executeCommand(
@@ -89,14 +89,13 @@ export default class CompareFile extends FileImportCommon {
8989

9090
private getImportedFileUri(importFilePath: string): Uri {
9191
const scheme = CompareFile.SCHEME;
92-
const provider = new (class implements vscode.TextDocumentContentProvider {
92+
const provider = new class implements vscode.TextDocumentContentProvider {
9393
provideTextDocumentContent(uri: vscode.Uri): string {
94-
return fs.readFileSync(importFilePath, 'utf-8');
94+
return fs.readFileSync(uri.fsPath, 'utf-8');
9595
}
96-
})();
96+
};
9797
vscode.workspace.registerTextDocumentContentProvider(scheme, provider);
98-
const accountCopyExtension = path.extname(importFilePath);
99-
const schemeUri = `${scheme}: ${CompareFile.ACCOUNT_COPY_BASE_NAME}.${accountCopyExtension}`;
98+
const schemeUri = `${scheme}:${importFilePath}`;
10099
return vscode.Uri.parse(schemeUri);
101100
}
102101

packages/vscode-extension/src/commands/SetupAccount.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export default class SetupAccount extends BaseAction {
302302
authid: authId,
303303
account: accountId,
304304
certificateid: certificateId,
305-
privatekeypath: privateKeyFilePath[0].fsPath,
305+
privatekeypath: `"${privateKeyFilePath[0].fsPath}"`,
306306
domain: url,
307307
};
308308

0 commit comments

Comments
 (0)