Because of "time of expansion".
Lets simplify the command:
$ echo --include=*.{scss,css}
--include=*.scss --include=*.css
As you can see, the braces were expanded by the "present running shell" (probably bash). And the * was not expanded as probably there is no file which name start with --include= and also ends on .scss (or .css) in the present directory.
However, in:
$ sh -c "echo --include=*.{scss,css}"
--include=*.{scss,css}
Two things happen:
the present running shell (PRS) doesn't expand the braces because they are quoted and are given literally to the next shell sh -c.
the next shell doesn't support brace expansion as leaves them as they are. Printing them with echo.
So, either make the PRS expand the braces:
sh -c 'echo "$@"' mysh --include=\*.{scss,css}
Which is complex and not the recommended solution. Or, use a brace aware shell:
bash -c 'echo --include=\*.{scss,css}'
Both * are quoted to prevent their expansion.
shhas no brace-expansion, use for examplebashorzshorcsh. see also Why is brace expansion not supported? – αғsнιη Feb 11 '20 at 17:48--include=*.{s,}css– Paulo Tomé Feb 11 '20 at 17:50findto find files andgrepto g/re/p within files. There are clues in the tools names to their intended use! – Ed Morton Feb 17 '20 at 20:43