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

Fix Uncaught Error: ENOENT: no such file or directory #1358

Merged
merged 1 commit into from Sep 14, 2020
Merged

Conversation

sadick254
Copy link
Contributor

@sadick254 sadick254 commented Sep 14, 2020

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Use JSON.stringify and JSON.parse since setting initialPaths using
e.dataTransfer.setData sets the array value to a DOMString.

Splitting the initialPaths on , fails if the root directory has a ',' as part of its name.

Relevant links

Alternate Designs

We could split initialPaths on ,/ but that would mean the items from index 1 onwards would have the incorrect path and we have to append / on every path.
consider

initialPaths = '/Users/home/some/file,/Users/home/some/anotherfile'
// If we split on './'
initialPaths = ['/Users/home/some/file', 'Users/home/some/anotherfile']

Benefits

Allow files to be moved to a root directory that has a ',' comma as part of its name

Possible Drawbacks

Not that i am aware of.

Applicable Issues

Resolves: #1357

Use JSON.stringify and JSON.parse since setting initialPaths using
e.dataTransfer.setData sets the array value to a DOMString.

Relevant links

https://developer.mozilla.org/en-US/docs/Web/API/DOMString
https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData
@sadick254 sadick254 self-assigned this Sep 14, 2020
@sadick254 sadick254 merged commit ec7e0f1 into master Sep 14, 2020
2 checks passed
@sadick254 sadick254 deleted the fix-ENOENT branch Sep 14, 2020
This was referenced Sep 15, 2020
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 this pull request may close these issues.

Uncaught Error: ENOENT: no such file or directory, lstat '/ Inc'
1 participant