File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 11import os
22import sys
33import re
4- from setup .static import LOGIN_ROBOT_FILE
4+ from setup .static import LOGIN_ROBOT_FILE , check_running_in_root
5+
56
67def check_file_exists ():
78 if not os .path .isfile (LOGIN_ROBOT_FILE ):
@@ -57,6 +58,7 @@ def check_content():
5758 sys .exit (1 )
5859
5960def main ():
61+ check_running_in_root ()
6062 check_file_exists ()
6163 check_content ()
6264
Original file line number Diff line number Diff line change 11import os
2+ import sys
3+
24ROBOT_ROOT_PATH = os .path .abspath (os .path .join ("." , "robot" ))
35LOGIN_ROBOT_FILE = os .path .abspath (os .path .join (ROBOT_ROOT_PATH , "login.robot" ))
46INVALID_LOGIN_ROBOT = os .path .abspath (os .path .join (ROBOT_ROOT_PATH , "invalid_login.robot" ))
810else :
911 CURRENT_ENV ["PYTHONPATH" ] = f"setup{ os .pathsep } "
1012
13+
1114def normalize (keyword ):
12- return keyword .strip ().title ()
15+ return keyword .strip ().title ()
16+
17+
18+ def check_running_in_root ():
19+ current_folder = os .getcwd ()
20+ supposed_exercises_folder = os .path .abspath (os .path .join (current_folder , "exercises" ))
21+ supposed_setup_folder = os .path .abspath (os .path .join (current_folder , "setup" ))
22+
23+ in_root = os .path .isdir (supposed_exercises_folder ) and os .path .isdir (supposed_setup_folder )
24+ if not in_root :
25+ print (f"🚩 Hmm. It looks like the script is running in '{ current_folder } ' instead of the repo root folder." )
26+ print ("For the verification to work correctly, you need to run the script from the root of the repository ("
27+ "probably named 'rf-katas')." )
28+ print ("Try again, but double-check that you're running the verify script from the repository root." )
29+ sys .exit (1 )
You can’t perform that action at this time.
0 commit comments