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

Globs don't work on Windows #204

Open
GrujicMilos opened this issue Jul 9, 2021 · 7 comments
Open

Globs don't work on Windows #204

GrujicMilos opened this issue Jul 9, 2021 · 7 comments
Labels
needs info Awaiting a response with more info from the reporter

Comments

@GrujicMilos
Copy link

I have project which use bootstrap. After install all necessary packages I wanted to migrate bootstrap scss files.

Example from my package.json:

"postinstall": "npm run migrate-bootstrap-sass", "migrate-bootstrap-sass": "sass-migrator division ../../../node_modules/bootstrap/scss/*.scss"

also I tried

"migrate-bootstrap-sass": "sass-migrator division ../../../node_modules/bootstrap/**/*.scss"

In both cases, migration does not work for me.

File by file migration works fine (you can see an example below).

"postinstall": "npm run migrate-bootstrap-bootstrap-grid && npm run migrate-bootstrap-variables ", "migrate-bootstrap-bootstrap-grid": "sass-migrator division ../../../node_modules/bootstrap/scss/bootstrap-grid.scss" "migrate-bootstrap-variables": "sass-migrator division ../../../node_modules/bootstrap/scss/_variables.scss"

I am using "sass-migrator": "^1.5.1", and my OS is Windows 10.
Please any help.

@GrujicMilos GrujicMilos changed the title Migrate more then one file in same time Migrate (sass-migrator division) more then one file in same time Jul 9, 2021
@jathak
Copy link
Member

jathak commented Jul 14, 2021

This might be due to the some weird interaction between Node and the Windows command line.

Does the same issue occur when you run the migrator command directly?

@GrujicMilos
Copy link
Author

I already tried migrator command directly. I have same issue when I run the migrator command directly.

@jathak
Copy link
Member

jathak commented Aug 4, 2021

Sorry for the delayed reply. Does wrapping the glob in single quotes (e.g. "sass-migrator division '../../../node_modules/bootstrap/scss/*.scss'") do anything? Windows doesn't support globs natively, so it's possible they're somehow being mangled before they make it to the migrator code.

@jathak jathak added the needs info Awaiting a response with more info from the reporter label Aug 17, 2021
@nardo7
Copy link

nardo7 commented Jan 20, 2022

I'm experiencing the same issue but for the module migrator:

I'm running sass-migrator --migrate-deps --load-path .\my\styles module .\path\to\the\app\src\**\*.scss and it doesn't work (returns Nothing to migrate!).
However running sass-migrator --migrate-deps --load-path .\my\styles module .\path\to\the\app\src\styles.scss or whatever single file path I give in, it does work.

Does the migrator actually work for multiple files paths or only for single file paths? I didn't find anything explicit about it in the documentation and every example is for one single file

Wrapping the path with single or double quotes doesn't change anything

Thanks for the help

@GrujicMilos
Copy link
Author

GrujicMilos commented Jan 20, 2022

I didn't find any solution for multiple files.
We have problem with third party libraries.
My team and me decided to wait third party libraries to migrate on Dart Sass 2.0.0.

@jathak jathak changed the title Migrate (sass-migrator division) more then one file in same time Globs don't work on Windows Jan 20, 2022
@jathak
Copy link
Member

jathak commented Jan 20, 2022

Renaming this since the problem isn't that multiple files aren't supported; it's that there seems to be an issue with globs on Windows. I don't have a proper development environment set up on Windows to debug at the moment, but I'll try to take a look sometime soon.

As a workaround in the meantime, running in a Unix-style shell (e.g. cygwin or, even better, WSL) should let you use the shell's native glob resolution.

@barkertron
Copy link

I had great success in Windows when using PowerShell via Windows Terminal. Globs worked fine for me in that environment, e.g. sass-migrator division **/scss/**/*.scss - I didn't have to use WSL/Cygwin at all. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Awaiting a response with more info from the reporter
Projects
None yet
Development

No branches or pull requests

4 participants