Skip to content

Commit 909317d

Browse files
committed
fix detect_dist
1 parent 2b90630 commit 909317d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

llms/extensions/publish/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,22 @@ async def detect_dist(request):
136136
return web.json_response({"dist": resolved_publish})
137137
return web.json_response({"dist": publish_prop})
138138

139-
if not project_paths:
140-
project_paths = ["$WORKSPACE"]
139+
special_prefixes = ("$WORKSPACE", "$TEMP")
140+
custom_paths = [p for p in project_paths if not p.startswith(special_prefixes)]
141141

142142
detected_dist = None
143-
for p in project_paths:
143+
first_custom_path = None
144+
for p in custom_paths:
144145
resolved = ctx.resolve_directory(p)
145146
if resolved:
147+
if first_custom_path is None:
148+
first_custom_path = resolved
146149
dist_path = os.path.join(resolved, "dist")
147150
if os.path.exists(dist_path) and os.path.isdir(dist_path):
148151
detected_dist = dist_path
149152
break
150153

151-
return web.json_response({"dist": detected_dist or ""})
154+
return web.json_response({"dist": detected_dist or first_custom_path or ""})
152155

153156
ctx.add_get("detect-dist", detect_dist)
154157

0 commit comments

Comments
 (0)