Skip to content

Commit 5fb953d

Browse files
authored
Doug/fix reachability engine cwd (#134)
* Changed variable from cwd to target_directory to ensure that the reachability engine writes the .socket.facts.json to the correct path * Additional fix for CLI Path
1 parent 6c97b6a commit 5fb953d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
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.36"
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.36'
2+
__version__ = '2.2.38'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

socketsecurity/core/tools/reachability.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ 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
139139
output_dir = str(pathlib.Path(output_path).parent)
140+
log.warning(f"output_dir: {output_dir}")
141+
log.warning(f"output_path: {output_path}")
140142
cmd.extend([
141143
"--output-dir", output_dir,
142144
"--socket-mode", output_path,
@@ -210,7 +212,7 @@ def run_reachability_analysis(
210212
result = subprocess.run(
211213
cmd,
212214
env=env,
213-
cwd=os.getcwd(),
215+
cwd=target_directory,
214216
stdout=sys.stderr, # Send stdout to stderr so user sees it
215217
stderr=sys.stderr, # Send stderr to stderr
216218
timeout=timeout + 60 if timeout else None # Add buffer to subprocess timeout

0 commit comments

Comments
 (0)