deviceframe icon indicating copy to clipboard operation
deviceframe copied to clipboard

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

Open aguerot opened this issue 3 years ago • 1 comments

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 avatar Nov 05 '20 20:11 aguerot

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`

aguerot avatar Nov 05 '20 21:11 aguerot