Skip to content

Commit

Permalink
wip: node-bridge mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlesisz committed Oct 22, 2024
1 parent f9b04a9 commit 3cff2c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
FIRMWARE_BIN_DIR = ROOT_DIR / "src/binaries/firmware/bin"
BRIDGE_BIN_DIR = ROOT_DIR / "src/binaries/trezord-go/bin"
NODE_BRIDGE_DIR = ROOT_DIR / "src/binaries/node-bridge"
LOCAL_NODE_BRIDGE_DIR = Path("/trezor-suite/packages/transport-bridge/dist").resolve()
USER_DOWNLOADED_DIR = FIRMWARE_BIN_DIR / "user_downloaded"
USER_DOWNLOADED_DIR.mkdir(exist_ok=True)

Expand Down
6 changes: 4 additions & 2 deletions src/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ def start(version: str, proxy: bool = False, output_to_logfile: bool = True) ->
def get_command_list() -> list[str]:
# Special handling of node-js bridge (experimental)
if "node" in version:
path = binaries.NODE_BRIDGE_DIR / "bin.js"
path = binaries.LOCAL_NODE_BRIDGE_DIR / "bin.js"
if not path.exists():
path = binaries.NODE_BRIDGE_DIR / "bin.js"
if not path.exists():
raise RuntimeError(f"Node bridge does not exist under {path}")
return ["node", str(path), "udp"]
return ["node", path, "udp"]
else:
bridge_location = binaries.BRIDGE_BIN_DIR / f"trezord-go-v{version}"
if not bridge_location.exists():
Expand Down

0 comments on commit 3cff2c3

Please sign in to comment.