Skip to content

Commit c71c7bf

Browse files
committed
v.0.2.9 update
1 parent 220e6ef commit c71c7bf

File tree

5 files changed

+46
-93
lines changed

5 files changed

+46
-93
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Change Log
2+
3+
## 0.2.9
4+
5+
- Fixed xml2js dependency vulnerability
6+
- Added option to download Intel® oneAPI Toolkits while setting up the enviroment
7+
28
## 0.2.8
39

410
- Updated dependencies

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ extensions for oneAPI Toolkits, see [Using Visual Studio Code with Intel® oneAP
1010

1111
You can initialize your environment with following steps.
1212

13-
1. Press `Ctrl+Shift+P (or View -> Command Palette...)` to open the Command Palette.
13+
1. Install one of [Intel® oneAPI Toolkits](https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#base-kit). Use Intel® oneAPI Base Toolkit as a default.
14+
2. Open your project in VSCode and press `Ctrl+Shift+P (or View -> Command Palette...)` to open the Command Palette.
1415
2. Type **Intel oneAPI** to view options of the installed extensions.
1516
3. Click on `Intel oneAPI: Initialize default environment variables`.
1617
4. If Visual Studio Code* asks for a location, locate your setvars script. **Linux**: the script is located in `<install dir>/intel/oneapi`. The default installation location is `/opt/intel/oneapi`. **Windows**: the script is located in `<install dir>\Intel\oneAPI\`. The default installation location is `C:\Program Files (x86)\Intel\oneAPI`.
@@ -43,11 +44,10 @@ Note that the name of the configuration file can be arbitrary, but it will be us
4344

4445
## Contributing
4546
Install Visual Studio Code (at least version 1.46) and open this project within it.
46-
You may also need `yarn` installed, and `node+npm`:
47+
You may also need `node+npm` installed:
4748

4849
```bash
49-
npm install -g yarn
50-
yarn install
50+
npm i
5151
code .
5252
```
5353

package-lock.json

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

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "oneapi-environment-configurator",
33
"displayName": "Environment Configurator for Intel® oneAPI Toolkits",
44
"description": "Configure environment for working with Intel® oneAPI Toolkits",
5-
"version": "0.2.8",
5+
"version": "0.2.9",
66
"license": "MIT",
77
"icon": "media/oneapi-logo.png",
88
"publisher": "intel-corporation",
@@ -76,8 +76,7 @@
7676
"mocha": "^10.2.0",
7777
"typescript": "^5.0.2",
7878
"@vscode/vsce": "^2.18.0",
79-
"vscode-extension-tester": "^5.5.1",
80-
"@vscode/test-electron": "^2.3.0"
79+
"vscode-extension-tester": "^5.5.1"
8180
},
8281
"dependencies": {},
8382
"repository": {

src/environment.ts

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,35 @@ export abstract class OneApiEnv {
7272

7373
protected async getEnvironment(isDefault: boolean): Promise<boolean | undefined> {
7474
const setvarsPath = await this.findSetvarsPath();
75+
7576
if (!setvarsPath) {
7677
const fileExtension = process.platform === 'win32' ? 'bat' : 'sh';
77-
vscode.window.showInformationMessage(`Could not find path to setvars.${fileExtension} or the path was not selected. Open settings and search for ONEAPI_ROOT to specify the path to the installation folder, then use the command palette to Initialize environment variables.`);
78-
const options: vscode.OpenDialogOptions = {
79-
canSelectMany: false,
80-
filters: {
81-
'oneAPI setvars file': [fileExtension],
82-
}
83-
};
84-
85-
const setVarsFileUri = await vscode.window.showOpenDialog(options);
86-
if (setVarsFileUri && setVarsFileUri[0]) {
87-
return await this.runSetvars(setVarsFileUri[0].fsPath, isDefault);
88-
} else {
89-
vscode.window.showErrorMessage(`Path to setvars.${fileExtension} is invalid.\n Open settings and search for ONEAPI_ROOT to specify the path to the installation folder, then use the command palette to Initialize environment variables.${fileExtension}.`, { modal: true });
78+
const install = 'Install Intel® oneAPI Toolkit';
79+
const setSetvars = 'Set path to setvars manually';
80+
const option = await vscode.window.showErrorMessage(
81+
`Could not find path to setvars.${fileExtension}. Probably Intel® oneAPI Toolkit is not installed or you can set path to setvars.${fileExtension} manually.`,
82+
install, setSetvars);
83+
if (option === install) {
84+
vscode.env.openExternal(vscode.Uri.parse(
85+
'https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html'));
9086
return false;
87+
} else if (option === setSetvars) {
88+
const options: vscode.OpenDialogOptions = {
89+
canSelectMany: false,
90+
filters: {
91+
'oneAPI setvars file': [fileExtension],
92+
}
93+
};
94+
95+
const setVarsFileUri = await vscode.window.showOpenDialog(options);
96+
if (setVarsFileUri && setVarsFileUri[0]) {
97+
return await this.runSetvars(setVarsFileUri[0].fsPath, isDefault);
98+
} else {
99+
vscode.window.showErrorMessage(`Path to setvars.${fileExtension} is invalid.\n Open settings and search for ONEAPI_ROOT to specify the path to the installation folder, then use the command palette to Initialize environment variables.${fileExtension}.`, { modal: true });
100+
return false;
101+
}
91102
}
103+
return false;
92104
} else {
93105
vscode.window.showInformationMessage(`oneAPI environment script was found in the following path: ${setvarsPath}`);
94106
return await this.runSetvars(setvarsPath, isDefault);

0 commit comments

Comments
 (0)