extension.js icon indicating copy to clipboard operation
extension.js copied to clipboard

Fix create not running on Windows

Open cezaraugusto opened this issue 1 year ago • 4 comments

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

cezaraugusto avatar Aug 27 '24 16:08 cezaraugusto

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

see 5 files with indirect coverage changes

codecov[bot] avatar Aug 27 '24 16:08 codecov[bot]

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

cezaraugusto avatar Aug 27 '24 17:08 cezaraugusto

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.

OSpoon avatar Aug 28 '24 02:08 OSpoon

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'
}

zh30 avatar Aug 28 '24 09:08 zh30

@OSpoon @zh30 please review it again extension@latest my-new-extension --template=new-react.

v2.0.0-alpha.7 "works on my machine"

Screenshot 2024-08-31 at 19 42 01

cezaraugusto avatar Aug 31 '24 22:08 cezaraugusto

I'll merge this one as completed, please re-open if I'm mistaken. Windows is tough love

cezaraugusto avatar Sep 01 '24 12:09 cezaraugusto

v2.0.0-alpha.8 works~ Thanks a lot.

xesam avatar Sep 02 '24 01:09 xesam