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

Bug: ENOTDIR, not a directory #172

Merged
merged 9 commits into from
Dec 28, 2020
Merged

Bug: ENOTDIR, not a directory #172

merged 9 commits into from
Dec 28, 2020

Conversation

baruchiro
Copy link
Collaborator

@baruchiro baruchiro commented Dec 25, 2020

Fixes #170

In the first commit- 4bcdb0d I just tried to avoid multi download. But I think we still have an issue with the executable location (in dev env it downloaded to the node_modules by default, and I think it have an execute permission problem).

In the commit 812be09, I injected the chromePath from the point before we starting to scrape each importer.

But then I thought the backend shouldn't depend on electron, it should just do its work, so it can get an optional download path (or just use the default like it was before my change), and the UI that know the Electron limitations, should inject the Electron specific path. See 97e3e1f

Verified

This commit was signed with the committer’s verified signature. The key has expired.
suzuki-shunsuke Shunsuke Suzuki

Verified

This commit was signed with the committer’s verified signature. The key has expired.
suzuki-shunsuke Shunsuke Suzuki
This reverts commit 4bcdb0d.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
(cherry picked from commit e607c1a)

Verified

This commit was signed with the committer’s verified signature. The key has expired.
suzuki-shunsuke Shunsuke Suzuki
Fixes #170

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@baruchiro baruchiro requested a review from brafdlog December 26, 2020 17:55
Copy link
Owner

@brafdlog brafdlog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand why you want to inject the path. Its a valid solution, but in my opinion it is not worth it (passing the parameter all over). The chrome path is an internal issue of the scraper code.

An alternative is to save a const of the base path in the filesystem and each code that needs to access the file system will work with that const (this applies to configManager as well?). This will centralise this logic to one variable. In the future if we will want a mode without electron we can set this variable as part of the run.

Both solutions are valid. Up to you

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@baruchiro
Copy link
Collaborator Author

I'm taking your suggestion mainly because the reason this path is not only related just to chrome. But now I see it affects only on the high-level, since you still need to get the resolved path to give it to the scraper (you also can use the download-chromium again only to resolve it).
Nevermind, the important thing is to not get stuck on these changeable things.

We need something like DependencyInjection, I don't know how implementing this design pattern in JS, if any.

Need to use this path in #173, I will comment there.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@baruchiro baruchiro merged commit 773cc90 into master Dec 28, 2020
@baruchiro baruchiro deleted the baruchiro/issue170 branch December 28, 2020 18:33
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.

Bug: ENOTDIR, not a directory
2 participants