Skip to content

Commit

Permalink
Incorporate @niksy's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianl committed Nov 24, 2020
1 parent e0e275a commit 93a87e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hyper_click/generic_path_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def resolve_as_file(self, path_name):
if path.isfile(path_name):
return path_name

with_ext = self.resolve_with_exts(path_name) or self.resolve_with_exts(path.join(path_name, 'index'))
with_ext = self.resolve_with_exts(path_name) or self.resolve_index(path_name)
if with_ext:
return with_ext

Expand Down Expand Up @@ -182,7 +182,7 @@ def resolve_node_modules(self, target, start_dir):
def resolve_index(self, dirname):
# matching ./demo to /demo/index.js
if path.isdir(dirname):
return self.resolve_as_file(path.join(dirname, 'index.js'))
return self.resolve_with_exts(path.join(dirname, 'index'))

def resolve_as_directory(self, dirname):
package_json_path = path.join(dirname, 'package.json')
Expand Down

0 comments on commit 93a87e1

Please sign in to comment.