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

Glob arguments are not expanded on Windows #66

Closed
ivkos opened this issue Nov 17, 2019 · 4 comments
Closed

Glob arguments are not expanded on Windows #66

ivkos opened this issue Nov 17, 2019 · 4 comments

Comments

@ivkos
Copy link

ivkos commented Nov 17, 2019

  • Globs are strings like src/*.lua that match multiple files
  • Linux bash-like shells expand them into a list of files when invoking a command, i.e. invoking this:
    • nodemcu-tool upload --minify --compile src/*.lua actually executes this:
    • nodemcu-tool upload --minify --compile src/init.lua src/my_script.lua
  • Windows shells (cmd.exe, PowerShell) do not do that and actually pass the arg with the wildcards into the application, so it deals with the glob internally

So, in short, the issue is that executing the same command in bash works fine, and fails in Windows shells due to the lack of glob expansion. This makes it hard to set up some useful scripts in my package.json that work on all platforms.

A possible solution would be parsing the CLI arguments and checking with is-glob whether the arg looks like a glob, then resolving it with glob into a list of files.

@AndiDittrich
Copy link
Owner

Hi @ivkos,

i can add this as features request but i didn't have the time to implement it soon - maybe in the future..

@ivkos
Copy link
Author

ivkos commented Nov 19, 2019

Thanks Andi. I'll see if I can help with this if I find some spare time.

@AndiDittrich
Copy link
Owner

i've just added a wrapper to invoke the glob expansion for the upload command

the expansion code is still empty (passthrough)

AndiDittrich added a commit that referenced this issue Dec 22, 2019
@AndiDittrich
Copy link
Owner

v3.2.0 is out including generic glob resolver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants