Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a8ed33e

Browse files
committedMay 29, 2025·
Correct path resolve
1 parent 6864d74 commit a8ed33e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed
 

‎FABulous/FABulous.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def main():
161161

162162
setup_global_env_vars(args)
163163

164-
projectDir = Path(os.getenv("FAB_PROJ_DIR", args.project_dir)).absolute()
164+
projectDir = Path(os.getenv("FAB_PROJ_DIR", args.project_dir)).absolute().resolve()
165165

166166
args.top = projectDir.stem
167167

@@ -197,6 +197,8 @@ def main():
197197
force=args.force,
198198
)
199199
fab_CLI.debug = args.debug
200+
fabScript: Path = args.FABulousScript.absolute()
201+
tclScript: Path = args.TCLScript.absolute()
200202
logger.info(f"Setting current working directory to: {projectDir}")
201203
os.chdir(projectDir)
202204

@@ -210,20 +212,25 @@ def main():
210212
f'Commands "{'; '.join(i.strip() for i in commands)}" executed successfully'
211213
)
212214
exit(0)
213-
elif args.FABulousScript != Path(""):
214-
if fab_CLI.onecmd_plus_hooks(f"run_script { projectDir / args.FABulousScript.absolute()}"):
215+
elif fabScript.is_file():
216+
if fab_CLI.onecmd_plus_hooks(f"run_script {fabScript}"):
215217
exit(1)
216218
else:
217219
logger.info(
218220
f"FABulous script {args.FABulousScript} executed successfully"
219221
)
220222
exit(0)
221-
elif args.TCLScript != Path(""):
222-
if fab_CLI.onecmd_plus_hooks(f"run_tcl {projectDir / args.TCLScript.absolute()}"):
223+
elif tclScript.is_file():
224+
if fab_CLI.onecmd_plus_hooks(f"run_tcl {tclScript}"):
223225
exit(1)
224226
else:
225227
logger.info(f"TCL script {args.TCLScript} executed successfully")
226228
exit(0)
229+
elif fabScript or tclScript:
230+
logger.error(
231+
"You have provided a FABulous script or a TCL script, but you have provided a path but not a file."
232+
)
233+
exit(1)
227234
else:
228235
fab_CLI.interactive = True
229236
if args.verbose == 2:

‎FABulous/FABulous_CLI/FABulous_CLI.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,6 @@ def do_run_tcl(self, args):
924924

925925
logger.info("TCL script executed")
926926

927-
if "exit" in script:
928-
return True
929927

930928
@with_category(CMD_USER_DESIGN_FLOW)
931929
@with_argparser(userDesignRequireParser)

0 commit comments

Comments
 (0)
Please sign in to comment.