-
-
Notifications
You must be signed in to change notification settings - Fork 4
Standardize output folder #248 #272
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
Conversation
|
Please also:
|
benoit74
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but while making the review I realize that scraper will rimraf the output folder. This is quite dangerous in general, but every more dangerous once we introduce this new output folder. Should user pass something wrong, he might loose significant data.
I propose that rather than rimraf on the output folder, we fail the scraper if output folder already exists. This is way safer.
Thanks for the suggestion, I have now made the script fail if the output directory already exists instead of deleting it. |
3ebb19d to
0830ce2
Compare
steps/export/converters.ts
Outdated
|
|
||
| const creator = new Creator() | ||
| creator.configIndexing(true, iso6393LanguageCode).configCompression(Compression.Zstd).startZimCreation(`./dist/${target.output}.zim`) | ||
| creator.configIndexing(true, iso6393LanguageCode).configCompression(Compression.Zstd).startZimCreation(`${targetDir}.zim`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You miss the file name from ${target.output} in this call. Beware that $targetDir might contain a trailing slash or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my! i skipped that part...so sorry for the back and fort. Will make the change and push now
benoit74
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please squash all your commits into one and force push them, I will merge them right after.
|
Sorry, I made a typo myself...
Adding issue number in Github commit does not link PR to issue properly. |
2d5ceb4 to
f5701d4
Compare
Oop! I have adjusted and push without the issue number. |
|
Nope, it is the first PR comment which must contain the issue number. |
I’ve been running into some issues squashing the commits properly. Would you recommend that I close this PR and open a new one with a clean commit history and the necessary changes, or should I continue troubleshooting the squash and force push here? |
|
Closing the PR will not help squashing commits. Something like this should do the trick: Or if you prefer : |
f5701d4 to
724af04
Compare
okay thanks...i just try out the second option |
benoit74
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not working in fact:
phet2zim --includeLanguages zh_CN --withoutLanguageVariants --output output2is not workingnpm run export -- --createMul --mulOnly --output output2is not working
Thanks for the feedback! I’ll take a closer look at why those commands aren’t working as expected. It’s possible that recent changes to path handling or CLI options affected them. I’ll reproduce the issue locally, fix it, and update the PR shortly. |
I tried running the same commands — phet2zim and npm run export — using the --dist option on the main branch, but it’s still not working for me either. I'm wondering if there's something I'm missing in the setup. Could you please guide me on what might be wrong or what else I should check? |
|
Same commands without So your code is wrong. You have to fix it. Period. |
Thanks for the clarification. I'd really like to fix it, but I'm having trouble running the app even on the main branch when using those same commands with the --output or --dist options. If you could guide me through getting it to work properly on main, that would really help me better understand what’s expected and how to fix it correctly. 🙏 |
|
Looks like you do not understand at all what you are doing, sorry but I can't help. |
I understand the task and the solution, and I’m sorry if I’ve caused any frustration. I’m still learning and trying to contribute meaningfully. I’d really love to fix the issue — all I’m saying is, even after forking the project, installing the dependencies, and running the commands as described, it’s still not working for me on the main branch. If there’s something I might be missing in the setup, I’d appreciate any pointers. Thanks for your time. |
724af04 to
b59f1f1
Compare
This PR modifies the scraper to change the default ZIM output folder from dist to output. It also adds a CLI option (--output) to allow users to specify a custom output directory.
Changes:
Updated the default output folder path.
Implemented the --output CLI option for flexibility.
Ensured backward compatibility by handling cases where output is not specified.