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

Throws ENOENT when dest is in tmpdir #60

Open
nandenjin opened this issue Dec 30, 2019 · 0 comments · May be fixed by #61
Open

Throws ENOENT when dest is in tmpdir #60

nandenjin opened this issue Dec 30, 2019 · 0 comments · May be fixed by #61

Comments

@nandenjin
Copy link

Internally dest path is converted to relative one by normalizePath() but it make fs.open() failed when dest is in tmpdir.

Sample

Environment

  • cpx: 1.5.0
  • NodeJS: v10.15.3
  • OS: macOS Catalina 10.15.2

Code

const os = require('os')
const cpx = require('cpx')

cpx.copySync('*.js', os.tmpdir())

Result

$ node tester.js
fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, copyfile 'tester.js' -> '../../../../../var/folders/1h/chh659g57sg3v_wks3v7z43h0000gn/T/tester.js'
    at Object.copyFileSync (fs.js:1723:3)
    at copyFile (/Users/nandenjin/sample_package/node_modules/cpx/node_modules/fs-extra/lib/copy-sync/copy-sync.js:68:8)
    at onFile (/Users/nandenjin/sample_package/node_modules/cpx/node_modules/fs-extra/lib/copy-sync/copy-sync.js:52:41)
    at getStats (/Users/nandenjin/sample_package/node_modules/cpx/node_modules/fs-extra/lib/copy-sync/copy-sync.js:47:39)
    at startCopy (/Users/nandenjin/sample_package/node_modules/cpx/node_modules/fs-extra/lib/copy-sync/copy-sync.js:37:10)
    at Object.copySync (/Users/nandenjin/sample_package/node_modules/cpx/node_modules/fs-extra/lib/copy-sync/copy-sync.js:32:10)
    at copyFileSync (/Users/nandenjin/sample_package/node_modules/cpx/lib/utils/copy-file-sync.js:50:12)
    at sourcePath (/Users/nandenjin/sample_package/node_modules/cpx/lib/copy-sync.js:63:13)
    at applyActionSync (/Users/nandenjin/sample_package/node_modules/cpx/lib/utils/apply-action-sync.js:36:9)
    at Object.copySync (/Users/nandenjin/sample_package/node_modules/cpx/lib/copy-sync.js:60:5)

@nandenjin nandenjin linked a pull request Dec 30, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant