@@ -161,7 +161,7 @@ def main():
161
161
162
162
setup_global_env_vars (args )
163
163
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 ()
165
165
166
166
args .top = projectDir .stem
167
167
@@ -197,6 +197,8 @@ def main():
197
197
force = args .force ,
198
198
)
199
199
fab_CLI .debug = args .debug
200
+ fabScript : Path = args .FABulousScript .absolute ()
201
+ tclScript : Path = args .TCLScript .absolute ()
200
202
logger .info (f"Setting current working directory to: { projectDir } " )
201
203
os .chdir (projectDir )
202
204
@@ -210,20 +212,25 @@ def main():
210
212
f'Commands "{ '; ' .join (i .strip () for i in commands )} " executed successfully'
211
213
)
212
214
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 } " ):
215
217
exit (1 )
216
218
else :
217
219
logger .info (
218
220
f"FABulous script { args .FABulousScript } executed successfully"
219
221
)
220
222
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 } " ):
223
225
exit (1 )
224
226
else :
225
227
logger .info (f"TCL script { args .TCLScript } executed successfully" )
226
228
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 )
227
234
else :
228
235
fab_CLI .interactive = True
229
236
if args .verbose == 2 :
0 commit comments