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

Folder name with double quote in path (") causes command to fail #26

Open
aguerot opened this issue Nov 5, 2020 · 1 comment
Open

Comments

@aguerot
Copy link

aguerot commented Nov 5, 2020

installed today on Windows 10
node v12.18.4
npm 6.14.6

executed command dframe *.png --frame "Apple Macbook Pro"

command fails with following errors :

❯ dframe *.png --frame "Apple Macbook Pro"
Downloading frame Apple Macbook Pro 13" [shadow] [                    ] Infinity/bps 1% 0.0s
× Error: EINVAL: invalid argument, mkdir 'C:\Users\antho\AppData\Local\deviceframe-nodejs\Cache\frames\Computers\Apple Macbook Pro\13"'
❯ dframe *.png --frame "Dell XPS 15"
Downloading frame Dell XPS 15" [shadow] [                    ] Infinity/bps 1% 0.0sevents.js:292
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'C:\Users\antho\AppData\Local\deviceframe-nodejs\Cache\frames\Computers\Dell XPS 15\Device with shadow\Dell XPS 15".png'
Emitted 'error' event on WriteStream instance at:
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at WriteStream.onerror (_stream_readable.js:752:7)
    at WriteStream.emit (events.js:315:20)
    at internal/fs/streams.js:361:12
    at FSReqCallback.oncomplete (fs.js:156:23) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\me\\AppData\\Local\\deviceframe-nodejs\\Cache\\frames\\Computers\\Dell XPS 15\\Device with shadow\\Dell XPS 15".png'
}

dframe *.png --frame "Microsoft Surface Book" works as there is no " in filename

Folders on Windows can not contain "

Any way I can workaround this ?

@aguerot
Copy link
Author

aguerot commented Nov 5, 2020

tried to fork and patch cli.js but I cant npm i on a clean fork because of similar issue :

npm ERR! error: invalid path 'Computers/Apple Macbook Air/11"/Device with shadow/Apple Macbook Air 11".png'

npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b 2.0.1 https://github.com/c0bra/deviceframe-frames.git C:\Users\antho\AppData\Roaming\npm-cache\_cacache\tmp\git-clone-9ec0f963 --config core.longpaths=true
npm ERR! warning: templates not found in C:\Users\antho\AppData\Local\Temp\pacote-git-template-tmp\git-clone-6dd4c33a
npm ERR! Note: switching to '7bd7e3cce054e318f95a8d5d15e36433d57fd8bf'.
npm ERR!
npm ERR! You are in 'detached HEAD' state. You can look around, make experimental
npm ERR! changes and commit them, and you can discard any commits you make in this
npm ERR! state without impacting any branches by switching back to a branch.
npm ERR!
npm ERR! If you want to create a new branch to retain commits you create, you may
npm ERR! do so (now or later) by using -c with the switch command. Example:
npm ERR!
npm ERR!   git switch -c <new-branch-name>
npm ERR! 
npm ERR! Or undo this operation with:
npm ERR!
npm ERR!   git switch -
npm ERR!
npm ERR! Turn off this advice by setting config variable advice.detachedHead to false
npm ERR!
npm ERR! error: invalid path 'Computers/Apple Macbook Air/11"/Device with shadow/Apple Macbook Air 11".png'
npm ERR! fatal: unable to checkout working tree
npm ERR! warning: Clone succeeded, but checkout failed.
npm ERR! You can inspect what was checked out with 'git status'
npm ERR! and retry with 'git restore --source=HEAD :/'
npm ERR!
npm ERR!```

I'll try my luck from WSL to see if I can `npm i`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant