Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line recursive globbing does not work on Windows #3087

Open
flatline opened this issue Sep 26, 2018 · 7 comments
Open

Command line recursive globbing does not work on Windows #3087

flatline opened this issue Sep 26, 2018 · 7 comments
Assignees
Labels
help wanted internal-issue-created An internal Google issue has been created to track this GitHub issue P3 triage-done Has been reviewed by someone on triage rotation.

Comments

@flatline
Copy link

flatline commented Sep 26, 2018

I'm having trouble getting the '**' command-line globbing operator for js files to work on Windows in recent releases. It appears to work on Linux just fine.

Windows example:

C:/temp/closure/test/test1.js
C:/temp/closure/test/test2.js

> java -jar compiler.jar --js='C:/temp/closure/**.js'
The compiler is waiting for input via stdin

Linux example:

/tmp/closure/test/test1.js
/tmp/closure/test/test2.js

> java -jar compiler.jar --js='/tmp/closure/**.js'
<compiled output>

@concavelenz
Copy link
Contributor

Chad I think you looked at something similiar recently?

@FRSgit
Copy link

FRSgit commented Oct 6, 2018

+1 on this, in my scenario:

google-closure-compiler index.js "./lib/**/*.js" --process_common_js_modules --module_resolution NODE

results in

{ Error: ENOENT: no such file or directory, open 'C:\Projects\FRSource\FRS-hide-scrollbar\lib\**\*.js'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at vvd (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\jscomp.js:6455:186)
    at ovd (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\jscomp.js:7882:451)
    at XO (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\jscomp.js:1938:29)
    at $O (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\jscomp.js:3371:44)
    at C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\jscomp.js:3573:46
    at CompilerJS.run (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\lib\node\closure-compiler-js.js:54:17)
    at getFilesFromStdin.then.inputFiles (C:\Projects\FRSource\FRS-hide-scrollbar\node_modules\google-closure-compiler\cli.js:149:31)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Projects\\FRSource\\FRS-hide-scrollbar\\lib\\**\\*.js' }

@ChadKillingsworth
Copy link
Collaborator

There's a couple of issues going on here. For instance #3087 is also applicable.

@FRSgit That glob pattern isn't recognized by Closure Compiler. "./lib/**.js" would be the correct version.

@FRSgit
Copy link

FRSgit commented Oct 6, 2018

@ChadKillingsworth but that means closure-compiler doesn't support minimatch-style glob (as stated in README). You think it should be noted in readme or maybe I should file a bug about that?

@ghosttie
Copy link

ghosttie commented Jan 9, 2019

I have a similar problem - I'm trying to exclude files and it's not working. I have

--js=!**template.js

in my command line but it still tries to process template.js.

I assumed the problem was caused by escaping, so I downloaded the source code and modified it to output the args to stdout but the arg makes it all the way into main without getting messed up.

@ghosttie
Copy link

I found a few issues:

  • the exclude filename is a relative path and the filename from the include is an absolute path so they aren't equal and the file gets included when it shouldn't
  • the excludes and includes are processed in the same loop so the order of parameters is significant, I don't know if this is intended
  • it searches through all subdirectories of the current directory looking for files matching the exclude glob and adding them to the exclude list which can be slow if the current directory contains a lot of files and folders. If possible it would be quicker to compare the included files to the excluded globs

@EatingW
Copy link
Contributor

EatingW commented Jan 10, 2019

Created Google internal issue http://b/122664915

@EatingW EatingW added triage-done Has been reviewed by someone on triage rotation. internal-issue-created An internal Google issue has been created to track this GitHub issue labels Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted internal-issue-created An internal Google issue has been created to track this GitHub issue P3 triage-done Has been reviewed by someone on triage rotation.
Projects
None yet
Development

No branches or pull requests

7 participants