Skip to content

Commit c70f18c

Browse files
committed
concider only local path when filtering src files
1 parent b2f38a6 commit c70f18c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

re-natal.coffee

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,13 +716,15 @@ extractRequiresFromSourceFile = (file) ->
716716
requires: requires
717717

718718
buildRequireByPlatformMap = () ->
719-
onlyUserCljs = (item) -> fpath.extname(item.path) == '.cljs' and
720-
item.path.indexOf('/target/') < 0 and # ignore target dir
721-
item.path.indexOf('/re-natal/') < 0 # ignore re-natal internal cljs files (can happen if re-natal is installed as a devDependency)
722-
files = klawSync process.cwd(),
719+
workdir = process.cwd()
720+
onlyUserCljs = (item) ->
721+
localpath = item.path.replace workdir, ''
722+
fpath.extname(localpath) == '.cljs' and localpath.indexOf('/target/') < 0 and localpath.indexOf('/re-natal/') < 0
723+
724+
files = klawSync workdir,
723725
nodir: true
724726
traverseAll: true
725-
filter: onlyUserCljs
727+
filter: onlyUserCljs
726728
filenames = files.map((o) -> o.path)
727729
extractedRequires = filenames.map(extractRequiresFromSourceFile)
728730

0 commit comments

Comments
 (0)