Skip to content

Commit

Permalink
Cleaning variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitcoder committed Oct 8, 2023
1 parent 07f8d14 commit b87b2d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions src/scans/tools/sca_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ impl ScaTool {
println!("[+] Manifests: {}", manfiests.clone());
}

let mut new_manifests = Vec::new();
let mut new_detect_manifests = Vec::new();
let new_manifests;
let new_detect_manifests ;

if manfiests != "" {
new_manifests = manfiests.split(",").collect::<Vec<&str>>();
Expand Down
6 changes: 3 additions & 3 deletions src/utils/common.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::collections::HashMap;
use std::{process::Command, os::unix::process::ExitStatusExt};
use futures::StreamExt;


use serde_json::Value;

// define statci exit codes and message
// define static exit codes and message

pub const EXIT_CODE_LICENSE_FAILED: i32 = 101;
pub const LICENSE_FAILED_MSG: &str = "License scan failed";
Expand Down Expand Up @@ -62,7 +61,8 @@ pub async fn execute_command(command: &str, suppress_error: bool) -> String {
let stderr = String::from_utf8_lossy(&output.stderr);
let status = &output.status;

if !stderr.is_empty() && status != &std::process::ExitStatus::from_raw(0) {
// check if the command executed successfully
if !stderr.is_empty() {
if !suppress_error {
println!("For command: {}", command);
print_error(format!("{}: {}", "Error executing process: ", stderr).as_str(), 101);
Expand Down
3 changes: 1 addition & 2 deletions src/utils/pipeline.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{process::exit, collections::HashMap};
use prettytable::{Table, row};
use serde_json::json;

use super::common;

Expand All @@ -15,7 +14,7 @@ pub async fn pipeline_failure(is_sast: bool, is_sca: bool, is_secret: bool, is_l
return;
}
let original_output = std::fs::read_to_string("/tmp/output.json").unwrap();
let mut json_output: serde_json::Value = serde_json::from_str(&original_output).expect("Error parsing JSON");
let json_output: serde_json::Value = serde_json::from_str(&original_output).expect("Error parsing JSON");

// start preparing results here
let mut sast_results = Vec::new();
Expand Down

0 comments on commit b87b2d4

Please sign in to comment.