File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 3737 - python scripts execution
3838 - shell scripts execution
3939
40+ On posix, posix Python and shell scripts are executed before mac or linux
41+ scripts.
42+
4043For example a tree could be looking like this::
4144 etc/conf
4245 base.txt : base pip requirements for all platforms
7073elif 'cygwin' in sys_platform :
7174 platform_names = ('posix' , 'cygwin' ,)
7275else :
73- # raise Exception ('Unsupported OS/platform')
76+ print ('Unsupported OS/platform' )
7477 platform_names = tuple ()
7578
7679
@@ -128,9 +131,14 @@ def get_conf_files(config_dir_paths, file_names=requirements):
128131 os .path .join (base_loc , path ),)
129132
130133 path , loc = current
131- collected += [os .path .join (path , f )
132- for f in os .listdir (loc ) if f in file_names
133- and os .path .join (path , f ) not in collected ]
134+ # we iterate on filenames to ensure the precedence of posix over
135+ # mac, linux, etc is repsected
136+ for n in file_names :
137+ for f in os .listdir (loc ):
138+ if f == n :
139+ f_loc = os .path .join (path , f )
140+ if f_loc not in collected :
141+ collected .append (f_loc )
134142
135143 return collected
136144
You can’t perform that action at this time.
0 commit comments