diff --git a/src/cmd/fix.rs b/src/cmd/fix.rs index 29b76a9..0461c7f 100644 --- a/src/cmd/fix.rs +++ b/src/cmd/fix.rs @@ -104,14 +104,24 @@ pub enum Error { }, } +#[cfg(target_family = "windows")] +fn fossa_path_command() -> &'static str { + "where.exe fossa" +} + +#[cfg(target_family = "unix")] +fn fossa_path_command() -> &'static str { + "which fossa" +} + #[cfg(target_family = "windows")] fn cli_command() -> &'static str { - "PATH ; fossa.exe analyze -o" + r#"$env:PATH="" ; analyze -o"# } #[cfg(target_family = "unix")] fn cli_command() -> &'static str { - r#"PATH="" fossa analyze -o"# + r#"PATH="" analyze -o"# } impl Error { @@ -263,6 +273,7 @@ impl Error { fn integration_scan_error(remote: &Remote, branch: &String) -> Self { let cli_command = cli_command().green(); + let fossa_path_command = fossa_path_command().green(); let git_command = format!("git clone -b {} {}", branch, remote).green(); let msg = formatdoc!( @@ -271,8 +282,12 @@ impl Error { To view the error, you must first download the failing integration. You can download the integration by using the following command: {git_command} - - Once the download is complete, you can debug the issue by running the following command in directory of your downloaded integration: + + Next, use the following command to locate the path of the fossa-cli: + + {fossa_path_command} + + Once the download is complete, you can debug the issue by running the following command in the directory of your downloaded integration: {cli_command}" ); diff --git a/src/cmd/run.rs b/src/cmd/run.rs index 7a4d451..706e239 100644 --- a/src/cmd/run.rs +++ b/src/cmd/run.rs @@ -136,7 +136,6 @@ struct ScanGitVCSReference { } impl ScanGitVCSReference { - /// Instantiate ScanGitVCSReference instance fn new(integration: &Integration, reference: &Reference) -> Self { Self { scan_id: Uuid::new_v4().to_string(), diff --git a/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_unix.snap b/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_unix.snap index 59f7524..733d588 100644 --- a/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_unix.snap +++ b/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_unix.snap @@ -21,10 +21,14 @@ Broker encountered an error while scanning your git remote at 'https://github.co To view the error, you must first download the failing integration. You can download the integration by using the following command: git clone -b master https://github.com/fossas/empty.git + +Next, use the following command to locate the path of the fossa-cli: + +which fossa + +Once the download is complete, you can debug the issue by running the following command in the directory of your downloaded integration: -Once the download is complete, you can debug the issue by running the following command in directory of your downloaded integration: - -PATH="" fossa analyze -o +PATH="" analyze -o Errors found while checking connection to FOSSA diff --git a/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_windows.snap b/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_windows.snap index a7de995..e65c91e 100644 --- a/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_windows.snap +++ b/tests/it/snapshots/it__fix__with_failing_http_no_auth_integration_scan_windows.snap @@ -21,10 +21,14 @@ Broker encountered an error while scanning your git remote at 'https://github.co To view the error, you must first download the failing integration. You can download the integration by using the following command: git clone -b master https://github.com/fossas/empty.git + +Next, use the following command to locate the path of the fossa-cli: + +where.exe fossa + +Once the download is complete, you can debug the issue by running the following command in the directory of your downloaded integration: -Once the download is complete, you can debug the issue by running the following command in directory of your downloaded integration: - -PATH ; fossa.exe analyze -o +$env:PATH="" ; analyze -o Errors found while checking connection to FOSSA