Closed chiubaka closed 2 years ago
Yeah, git bisect
agrees with my assessment :(((
Here's the library that yeoman is using internally for spawnCommand
and spawnCommandSync
: https://github.com/sindresorhus/execa
And here's the code for those two commands: https://github.com/yeoman/generator/blob/357932222b7806e6d3e60c44d5cbdd9b2da74dcf/lib/actions/spawn-command.js
Honestly, though, the weirder thing is the way destinationRoot
is undefined
in all the generators?? Something happened that's squashing that value. If that value were still around, I could just pass it to exec
and everything would work normally.
Alright, destinationRoot
being undefined
is intentional. That happens here: https://github.com/yeoman/generator/blob/main/lib/index.js#L201-L202
Ok, figured out that destinationRoot()
the method is what I should be using. It's now easy to pass cwd
to the exec
command, and things work as normal.
One catch: exec
is nice in a lot of ways because it gives me stdout
and stderr
as strings after execution. However, this does mean that I'm no longer able to see what's happening as the generator does its work, so it feels like the generator is just stalling for awhile.
This makes #98 a bit more urgent.
Also, need to come up with a regression test for this bug, since it was pretty nasty...
Not sure when this started, but noticed while playing with #45. It correctly writes a bunch of the files to
/tmp/generated
, but then tries to run things likelint:fix
in the current working directory.Maybe this is because of #124? Perhaps this is one of the things the internal function was doing... damnit.