Skip to content

Commit 6551068

Browse files
authored
Merge pull request #70 from ggbecker/minor-fix-to-open-built-content
Remove fallback option in Open Built content.
2 parents 1d4aefe + c6907f2 commit 6551068

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Change Log
2+
## [1.0.1] - 2022-07-18
3+
### Fixed
4+
- Open Built content: only the fallback (RHEL8) built content was being opened. The fallback option was removed.
25
## [1.0.0] - 2022-07-14
36
### Added
47
- Option to open built content files.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Content Navigator",
55
"description": "Content Navigator helps security content authors to create content for https://github.com/ComplianceAsCode/content",
66
"icon": "icon.png",
7-
"version": "1.0.0",
7+
"version": "1.0.1",
88
"license": "BSD-3-Clause",
99
"engines": {
1010
"vscode": "^1.59.0"

src/content-navigator.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// The module 'vscode' contains the VS Code extensibility API
22
// Import the module and reference it with the alias vscode in your code below
3-
import { runInContext } from 'vm';
43
import * as vscode from 'vscode';
54

65
export function getRuleId(): string
@@ -222,17 +221,11 @@ export async function openVariableFile(built_content: boolean) {
222221
}
223222

224223
async function openBuiltFile(rule_id : string, location : string) : Promise<boolean> {
225-
const config = vscode.workspace.getConfiguration('content-navigator')
226224
let uries;
227225

228-
// product name - defaults to rhel8 if the build/product folder is not found
226+
// get product name
227+
const config = vscode.workspace.getConfiguration('content-navigator')
229228
let product = config.get('testSuite.productName')
230-
let uri = vscode.Uri.file("build/"+product);
231-
try {
232-
await vscode.workspace.fs.stat(uri);
233-
} catch {
234-
product = "rhel8"
235-
}
236229

237230
if(location == "rule.yml") {
238231
uries = await vscode.workspace.findFiles('build/' + product + '/rules/' + rule_id + ".yml");

0 commit comments

Comments
 (0)