Skip to content

Commit

Permalink
Merge pull request #70 from ggbecker/minor-fix-to-open-built-content
Browse files Browse the repository at this point in the history
Remove fallback option in Open Built content.
  • Loading branch information
ggbecker authored Jul 18, 2022
2 parents 1d4aefe + c6907f2 commit 6551068
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log
## [1.0.1] - 2022-07-18
### Fixed
- Open Built content: only the fallback (RHEL8) built content was being opened. The fallback option was removed.
## [1.0.0] - 2022-07-14
### Added
- Option to open built content files.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Content Navigator",
"description": "Content Navigator helps security content authors to create content for https://github.com/ComplianceAsCode/content",
"icon": "icon.png",
"version": "1.0.0",
"version": "1.0.1",
"license": "BSD-3-Clause",
"engines": {
"vscode": "^1.59.0"
Expand Down
11 changes: 2 additions & 9 deletions src/content-navigator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import { runInContext } from 'vm';
import * as vscode from 'vscode';

export function getRuleId(): string
Expand Down Expand Up @@ -222,17 +221,11 @@ export async function openVariableFile(built_content: boolean) {
}

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

// product name - defaults to rhel8 if the build/product folder is not found
// get product name
const config = vscode.workspace.getConfiguration('content-navigator')
let product = config.get('testSuite.productName')
let uri = vscode.Uri.file("build/"+product);
try {
await vscode.workspace.fs.stat(uri);
} catch {
product = "rhel8"
}

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

0 comments on commit 6551068

Please sign in to comment.