Skip to content

Commit

Permalink
Make imports with leading dot always relative
Browse files Browse the repository at this point in the history
Fix #18.
  • Loading branch information
klmr committed Jun 17, 2014
1 parent 8a3f337 commit fc89277
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/find_module.r
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ find_module = function (module) {
module_path = do.call(file.path, as.list(prefix))
file_pattern = sprintf('^%s\\.[rR]$', suffix)

candidate_paths = file.path(import_search_path(), module_path)
search_path = if (parts[1] %in% c('.', '..'))
module_base_path(environment())
else
import_search_path()
candidate_paths = file.path(search_path, module_path)

# For each candidate, try finding a module file. A module file is either
# `{suffix}.r` or `{suffix}/__init__.r`, preceded by the path prefix.
Expand Down

0 comments on commit fc89277

Please sign in to comment.