From 4bc20527c3c7d78846992e254ee557d2ffa81ec9 Mon Sep 17 00:00:00 2001 From: Safi Date: Wed, 22 Apr 2026 23:01:53 +0100 Subject: [PATCH] fix #513 #514: skip head -1 on .exe hook binary, fix to_canvas() hardcoded obsidian path --- graphify/export.py | 2 +- graphify/hooks.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/graphify/export.py b/graphify/export.py index cd00f1bb..0e96bdb7 100644 --- a/graphify/export.py +++ b/graphify/export.py @@ -831,7 +831,7 @@ def to_canvas( canvas_nodes.append({ "id": f"n_{node_id}", "type": "file", - "file": f"graphify/obsidian/{fname}.md", + "file": f"{fname}.md", "x": nx_x, "y": nx_y, "width": 180, diff --git a/graphify/hooks.py b/graphify/hooks.py index 6e0155f1..3fa7d2e5 100644 --- a/graphify/hooks.py +++ b/graphify/hooks.py @@ -13,7 +13,10 @@ _PYTHON_DETECT = """\ # Detect the correct Python interpreter (handles pipx, venv, system installs) GRAPHIFY_BIN=$(command -v graphify 2>/dev/null) if [ -n "$GRAPHIFY_BIN" ]; then - _SHEBANG=$(head -1 "$GRAPHIFY_BIN" | sed 's/^#![[:space:]]*//') + case "$GRAPHIFY_BIN" in + *.exe) _SHEBANG="" ;; + *) _SHEBANG=$(head -1 "$GRAPHIFY_BIN" | sed 's/^#![[:space:]]*//') ;; + esac case "$_SHEBANG" in */env\\ *) GRAPHIFY_PYTHON="${_SHEBANG#*/env }" ;; *) GRAPHIFY_PYTHON="$_SHEBANG" ;;