@@ -110,8 +110,8 @@ def run(
110
110
111
111
pkg_root = get_installed_path (package )
112
112
possible_prefixes = [
113
- osp .join (pkg_root , '.mim' , 'tools/ ' ),
114
- osp .join (pkg_root , 'tools/ ' )
113
+ osp .join (pkg_root , '.mim' , f 'tools{ os . sep } ' ),
114
+ osp .join (pkg_root , f 'tools{ os . sep } ' )
115
115
]
116
116
for possible_prefix in possible_prefixes :
117
117
if osp .exists (possible_prefix ):
@@ -121,15 +121,15 @@ def run(
121
121
command_domain = ''
122
122
if ':' in command :
123
123
split_command = command .split (':' )
124
- command_domain = '/' .join (split_command [:- 1 ])
124
+ command_domain = os . sep .join (split_command [:- 1 ])
125
125
command = split_command [- 1 ]
126
126
127
127
files = recursively_find (prefix , command + '.py' )
128
128
129
129
if command_domain == '' :
130
- suffix = f'/ { command } .py'
130
+ suffix = f'{ os . sep } { command } .py'
131
131
else :
132
- suffix = f'/ { command_domain } / { command } .py'
132
+ suffix = f'{ os . sep } { command_domain } { os . sep } { command } .py'
133
133
files = [f for f in files if f .endswith (suffix )]
134
134
135
135
if len (files ) == 0 :
@@ -142,11 +142,11 @@ def run(
142
142
echo_warning (f )
143
143
144
144
# Use the shortest path
145
- files .sort (key = lambda x : len (x .split ('/' )))
145
+ files .sort (key = lambda x : len (x .split (os . sep )))
146
146
echo_warning (f'We are using the script { files [0 ]} . ' )
147
147
echo_warning ('To use other scripts, you need to use these commands: ' )
148
148
for f in files [1 :]:
149
- cmd = f .split (prefix )[1 ].split ('.' )[0 ].replace ('/' , ':' )
149
+ cmd = f .split (prefix )[1 ].split ('.' )[0 ].replace (os . sep , ':' )
150
150
echo_warning (f'Command for { f } : { cmd } ' )
151
151
152
152
script = files [0 ]
0 commit comments