Skip to content

Commit b057fa4

Browse files
committed
Additional fix for CLI Path
1 parent 00ee6a7 commit b057fa4

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.2.37"
9+
version = "2.2.38"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.2.37'
2+
__version__ = '2.2.38'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

socketsecurity/core/tools/reachability.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,15 @@ def run_reachability_analysis(
133133
cli_package = self._ensure_coana_cli_installed(version)
134134

135135
# Build CLI command arguments
136-
cmd = ["npx", cli_package, "run", target_directory]
136+
cmd = ["npx", cli_package, "run", "."]
137137

138138
# Add required arguments
139-
# If output_path is relative, it should be relative to target_directory
140-
if not os.path.isabs(output_path):
141-
full_output_path = os.path.join(target_directory, output_path)
142-
else:
143-
full_output_path = output_path
144-
145-
output_dir = str(pathlib.Path(full_output_path).parent)
139+
output_dir = str(pathlib.Path(output_path).parent)
140+
log.warning(f"output_dir: {output_dir}")
141+
log.warning(f"output_path: {output_path}")
146142
cmd.extend([
147143
"--output-dir", output_dir,
148-
"--socket-mode", full_output_path,
144+
"--socket-mode", output_path,
149145
"--disable-report-submission"
150146
])
151147

@@ -227,15 +223,15 @@ def run_reachability_analysis(
227223
raise Exception(f"Reachability analysis failed with exit code {result.returncode}")
228224

229225
# Extract scan ID from output file
230-
scan_id = self._extract_scan_id(full_output_path)
226+
scan_id = self._extract_scan_id(output_path)
231227

232228
log.info(f"Reachability analysis completed successfully")
233229
if scan_id:
234230
log.info(f"Scan ID: {scan_id}")
235231

236232
return {
237233
"scan_id": scan_id,
238-
"report_path": full_output_path,
234+
"report_path": output_path,
239235
"tar_hash_used": tar_hash
240236
}
241237

0 commit comments

Comments
 (0)