Skip to content

Commit ccd6712

Browse files
VicVic
authored andcommitted
fixed pyob_launcher for custom path
1 parent 9e3eab9 commit ccd6712

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

build_pyinstaller_multiOS.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,35 @@
77
def main():
88
os_name = platform.system().lower()
99
project_root = Path(__file__).parent.absolute()
10-
VERSION = "0.2.6"
10+
VERSION = "0.3.0"
1111
APP_NAME = "Py-OB"
1212
print(f"🚀 Forging {APP_NAME} v{VERSION} for {os_name}...")
13+
1314
common = [
1415
f"--name={APP_NAME}",
1516
"--clean",
1617
"--noconfirm",
1718
"--paths=src",
1819
"--collect-all=pyob",
20+
"--collect-all=requests",
21+
"--collect-all=charset_normalizer",
22+
"--collect-all=chardet",
1923
"--hidden-import=pyob.autoreviewer",
2024
"--hidden-import=pyob.core_utils",
2125
"--hidden-import=pyob.prompts_and_memory",
2226
"--hidden-import=pyob.reviewer_mixins",
2327
"--hidden-import=pyob.entrance",
2428
"--hidden-import=pyob.pyob_code_parser",
2529
"--hidden-import=pyob.pyob_dashboard",
26-
"--hidden-import=requests",
2730
"--hidden-import=ollama",
2831
"--hidden-import=textwrap",
2932
"--hidden-import=pathlib",
30-
"--hidden-import=charset_normalizer",
31-
"--hidden-import=chardet",
3233
"--copy-metadata=requests",
3334
"--copy-metadata=charset-normalizer",
3435
"--copy-metadata=chardet",
3536
"--collect-all=ruff",
3637
"--collect-all=mypy",
3738
"--collect-all=ollama",
38-
"--collect-all=charset_normalizer",
39-
"--collect-all=chardet",
4039
"src/pyob/pyob_launcher.py",
4140
]
4241

src/pyob/pyob_launcher.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def load_config():
5757

5858
def ensure_terminal():
5959
if ".app/Contents/MacOS" in sys.executable and not os.isatty(sys.stdin.fileno()):
60-
# Reconstruct the command to run the script with its original arguments
6160
script_path = shlex.quote(sys.argv[0])
6261
args = " ".join(shlex.quote(arg) for arg in sys.argv[1:])
6362
full_command = f"{sys.executable} {script_path} {args}".strip()
@@ -78,19 +77,25 @@ def main():
7877
os.environ["PYOB_GEMINI_MODEL"] = config.get("gemini_model", DEFAULT_GEMINI_MODEL)
7978
os.environ["PYOB_LOCAL_MODEL"] = config.get("local_model", DEFAULT_LOCAL_MODEL)
8079

81-
# Absolute import for the package
8280
from pyob.entrance import EntranceController
8381

8482
if len(sys.argv) > 1:
85-
target_dir = sys.argv[1]
83+
arg = sys.argv[1]
84+
if ".app/Contents/MacOS" in arg or arg == sys.executable:
85+
target_dir = input(
86+
"\nEnter the FULL PATH to your target project directory\n"
87+
"(or just press Enter to use the current folder): "
88+
).strip()
89+
else:
90+
target_dir = arg
8691
else:
8792
target_dir = input(
8893
"\nEnter the FULL PATH to your target project directory\n"
8994
"(or just press Enter to use the current folder): "
9095
).strip()
9196

92-
if not target_dir:
93-
target_dir = "."
97+
if not target_dir:
98+
target_dir = "."
9499

95100
target_dir = os.path.abspath(target_dir)
96101

0 commit comments

Comments
 (0)