Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit 822cd9e

Browse files
committed
fix config.json path for executable
1 parent 91e062d commit 822cd9e

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pyinstaller --onefile --hidden-import=tiktoken --hidden-import=tiktoken_ext.openai_public --hidden-import=tiktoken_ext --add-data "config.json;." gitdiff4llm.py
1+
pyinstaller --onefile --hidden-import=tiktoken --hidden-import=tiktoken_ext.openai_public --hidden-import=tiktoken_ext gitdiff4llm.py
22
pause

config.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"tiktoken_model": "gpt-4o",
3-
"diffs": [
4-
["-U50", "--ignore-all-space", "--", ":!*Test*"],
5-
["-U20", "--ignore-all-space", "--", "*Test*"]
6-
]
7-
}
8-
2+
"tiktoken_model": "gpt-4o",
3+
"diffs": [
4+
["-U50", "--ignore-all-space", "--", "*.cs", ":!*Test*.cs", ":!*.xml"],
5+
["-U20", "--ignore-all-space", "--", "*Test*.cs", ":!*.xml"],
6+
["-U5", "--ignore-all-space", "--", "*.xml"]
7+
]
8+
}

gitdiff4llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def load_config(config_file_name="config.json"):
2828
# Check if running as a PyInstaller bundle (frozen)
2929
if getattr(sys, 'frozen', False):
3030
# If the application is run as a PyInstaller bundle, use the _MEIPASS directory
31-
script_dir = sys._MEIPASS
31+
script_dir = os.path.dirname(sys.executable)
3232
else:
3333
# If running in a normal Python environment, use the script directory
3434
script_dir = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)