Fix create not running on Windows
There are several reports of create not working on Windows for v2. This PR fixes it.
Fix #159
How to test (must run on Windows)
npx extension@latest my-new-extension --template=new-react
Fix is in [email protected]. Please confirm patch works @xesam @zh30. Also note that v2 has a different/bigger set of templates: link. Running any of these folders as template name (e.g. npx extension@latest my-new-extension --template=new-react should be enough to pull the data.
cc @OSpoon if you can check as well
I am certain that the issue is due to the mv command not existing in the go-git-it package on Windows, and it needs to be considered how to make mv and rm operations compatible on Windows.
No success yet.
pnpm dlx extension@latest create . --template=react-typescript
🐣 - Starting a new browser extension named browser-extension-template...
🤝 - Ensuring browser-extension-template folder exists...
🤞 - Checking if destination path is writeable...
🔎 - Scanning for potential conflicting files...
🧰 - Installing browser-extension-template from template react-typescript...
Removing existing .go-git-it-temp-folder...
[====== ] 11% 16.7sError pulling git repository: Error: Command failed: mv examples/react-typescript /Users/henry/code/react-typescript
mv: rename examples/react-typescript to /Users/henry/code/react-typescript: No such file or directory
at genericNodeError (node:internal/errors:984:15)
at wrappedFn (node:internal/errors:538:14)
at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1105:16)
at Socket.<anonymous> (node:internal/child_process:457:11)
at Socket.emit (node:events:519:28)
at Pipe.<anonymous> (node:net:339:12) {
code: 1,
killed: false,
signal: null,
cmd: 'mv examples/react-typescript /Users/henry/code/react-typescript',
stdout: '',
stderr: 'mv: rename examples/react-typescript to /Users/henry/code/react-typescript: No such file or directory\n'
}
@OSpoon @zh30 please review it again extension@latest my-new-extension --template=new-react.
v2.0.0-alpha.7 "works on my machine"
I'll merge this one as completed, please re-open if I'm mistaken. Windows is tough love
v2.0.0-alpha.8 works~ Thanks a lot.